From: Johannes Schindelin Date: Thu, 19 Sep 2019 21:43:03 +0000 (+0200) Subject: mingw: sh arguments need quoting in more circumstances X-Git-Tag: v2.24.1~1^2~1^2~1^2~1^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7d8b676992ba0418aeb78f0ad1f4e193ad979b2e;p=thirdparty%2Fgit.git mingw: sh arguments need quoting in more circumstances Previously, we failed to quote characters such as '*', '(' and the likes. Let's fix this. Signed-off-by: Johannes Schindelin --- diff --git a/compat/mingw.c b/compat/mingw.c index 7635ad5152..2c55c3426c 100644 --- a/compat/mingw.c +++ b/compat/mingw.c @@ -1120,13 +1120,14 @@ static const char *quote_arg_msys2(const char *arg) for (p = arg; *p; p++) { int ws = isspace(*p); - if (!ws && *p != '\\' && *p != '"' && *p != '{') + if (!ws && *p != '\\' && *p != '"' && *p != '{' && *p != '\'' && + *p != '?' && *p != '*' && *p != '~') continue; if (!buf.len) strbuf_addch(&buf, '"'); if (p != p2) strbuf_add(&buf, p2, p - p2); - if (!ws && *p != '{') + if (*p == '\\' || *p == '"') strbuf_addch(&buf, '\\'); p2 = p; }