]> git.ipfire.org Git - thirdparty/git.git/commit
mingw: fix quoting of empty arguments for `sh`
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Thu, 19 Sep 2019 21:38:33 +0000 (23:38 +0200)
committerJohannes Schindelin <johannes.schindelin@gmx.de>
Fri, 6 Dec 2019 15:31:14 +0000 (16:31 +0100)
commit04522edbd4086cd9063a8e65664c11a87bb7d89e
tree19674c45be2c26de0e4740a9df3ae3bfab5a22bb
parent49f7a76d57c78e55f2f72e44664824f3fecb8837
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>
compat/mingw.c