@matheusbsbs / matheus-bagliano / commits / 49f7a76d57
Fork 0

mingw: use MSYS2 quoting even when spawning shell scripts

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>

Johannes Schindelin committed Sep 19, 2019 at 17:05 UTC 49f7a76d57c78e55f2f72e44664824f3fecb8837
1 file changed +2 -1
compat/mingw.c
+2 -1
@@ -1439,7 +1439,8 @@ static pid_t mingw_spawnve_fd(const char *cmd, const char **argv, char **deltaen
1439 BOOL ret;
1440 HANDLE cons;
1441 const char *(*quote_arg)(const char *arg) =
1442 - is_msys2_sh(*argv) ? quote_arg_msys2 : quote_arg_msvc;
1442 + is_msys2_sh(cmd ? cmd : *argv) ?
1443 + quote_arg_msys2 : quote_arg_msvc;
1444
1445 do_unset_environment_variables();
1446