]> git.ipfire.org Git - thirdparty/git.git/commitdiff
mingw: use MSYS2 quoting even when spawning shell scripts
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Thu, 19 Sep 2019 15:05:45 +0000 (17:05 +0200)
committerJohannes Schindelin <johannes.schindelin@gmx.de>
Fri, 6 Dec 2019 15:31:14 +0000 (16:31 +0100)
At the point where `mingw_spawn_fd()` is called, we already have a full
path to the script interpreter in that scenario, and we pass it in as
the executable to run, while the `argv` reflect what the script should
receive as command-line.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
compat/mingw.c

index 5dbaae981e40fa3ef91f54a29ce9a42aaedf68c9..32fc02e36053a5381962d2ef34c7e96a28ff1317 100644 (file)
@@ -1439,7 +1439,8 @@ static pid_t mingw_spawnve_fd(const char *cmd, const char **argv, char **deltaen
        BOOL ret;
        HANDLE cons;
        const char *(*quote_arg)(const char *arg) =
-               is_msys2_sh(*argv) ? quote_arg_msys2 : quote_arg_msvc;
+               is_msys2_sh(cmd ? cmd : *argv) ?
+               quote_arg_msys2 : quote_arg_msvc;
 
        do_unset_environment_variables();