From 38e1b075b49664181a6b1727219b404debec035e Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Mon, 8 Aug 2022 18:30:43 -0700 Subject: Fix some issues with backslashed wildcards in args. --- options.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'options.c') diff --git a/options.c b/options.c index 9731a144..a60ff515 100644 --- a/options.c +++ b/options.c @@ -2521,7 +2521,10 @@ char *safe_arg(const char *opt, const char *arg) const char *f = arg; char *t = ret + len1; while (*f) { - if (strchr(escapes, *f)) + if (*f == '\\') { + if (!is_filename_arg || !strchr(WILD_CHARS, f[1])) + *t++ = '\\'; + } else if (strchr(escapes, *f)) *t++ = '\\'; *t++ = *f++; } -- cgit v1.2.1