Skip to content

Commit 04522ed

Browse files
committed
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 <[email protected]>
1 parent 49f7a76 commit 04522ed

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compat/mingw.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1136,7 +1136,7 @@ static const char *quote_arg_msys2(const char *arg)
11361136
else if (!buf.len)
11371137
return arg;
11381138
else
1139-
strbuf_add(&buf, p2, p - p2),
1139+
strbuf_add(&buf, p2, p - p2);
11401140

11411141
strbuf_addch(&buf, '"');
11421142
return strbuf_detach(&buf, 0);

0 commit comments

Comments
 (0)