diff options
author | Johannes Schindelin <johannes.schindelin@gmx.de> | 2019-09-19 23:38:33 +0200 |
---|---|---|
committer | Johannes Schindelin <johannes.schindelin@gmx.de> | 2019-12-06 16:31:14 +0100 |
commit | 04522edbd4086cd9063a8e65664c11a87bb7d89e (patch) | |
tree | 19674c45be2c26de0e4740a9df3ae3bfab5a22bb /compat | |
parent | mingw: use MSYS2 quoting even when spawning shell scripts (diff) | |
download | tgif-04522edbd4086cd9063a8e65664c11a87bb7d89e.tar.xz |
mingw: fix quoting of empty arguments for `sh`
When constructing command-lines to spawn processes, it is an unfortunate
but necessary decision to quote arguments differently: MSYS2 has
different dequoting rules (inherited from Cygwin) than the rest of
Windows.
To accommodate that, Git's Windows compatibility layer has two separate
quoting helpers, one for MSYS2 (which it uses exclusively when spawning
`sh`) and the other for regular Windows executables.
The MSYS2 one had an unfortunate bug where a `,` somehow slipped in,
instead of the `;`. As a consequence, empty arguments would not be
enclosed in a pair of double quotes, but the closing double quote was
skipped.
Let's fix this.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Diffstat (limited to 'compat')
-rw-r--r-- | compat/mingw.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compat/mingw.c b/compat/mingw.c index 32fc02e360..7635ad5152 100644 --- a/compat/mingw.c +++ b/compat/mingw.c @@ -1136,7 +1136,7 @@ static const char *quote_arg_msys2(const char *arg) else if (!buf.len) return arg; else - strbuf_add(&buf, p2, p - p2), + strbuf_add(&buf, p2, p - p2); strbuf_addch(&buf, '"'); return strbuf_detach(&buf, 0); |