1 From 70f3b798ef7a254a367ae75b2a95c7b6c267db00 Mon Sep 17 00:00:00 2001
2 From: Johannes Schindelin <johannes.schindelin@gmx.de>
3 Date: Thu, 19 Sep 2019 23:43:03 +0200
4 Subject: mingw: sh arguments need quoting in more circumstances
6 Previously, we failed to quote characters such as '*', '(' and the
9 Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
10 (cherry picked from commit 7d8b676992ba0418aeb78f0ad1f4e193ad979b2e)
11 Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
13 compat/mingw.c | 5 +++--
14 1 file changed, 3 insertions(+), 2 deletions(-)
16 diff --git a/compat/mingw.c b/compat/mingw.c
17 index 8115fbafc7..bd24d913f9 100644
20 @@ -1122,13 +1122,14 @@ static const char *quote_arg_msys2(const char *arg)
22 for (p = arg; *p; p++) {
24 - if (!ws && *p != '\\' && *p != '"' && *p != '{')
25 + if (!ws && *p != '\\' && *p != '"' && *p != '{' && *p != '\'' &&
26 + *p != '?' && *p != '*' && *p != '~')
29 strbuf_addch(&buf, '"');
31 strbuf_add(&buf, p2, p - p2);
32 - if (!ws && *p != '{')
33 + if (*p == '\\' || *p == '"')
34 strbuf_addch(&buf, '\\');
38 2.24.0.393.g34dc348eaf