Skip to content

Commit 49f7a76

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

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

compat/mingw.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1439,7 +1439,8 @@ static pid_t mingw_spawnve_fd(const char *cmd, const char **argv, char **deltaen
14391439
BOOL ret;
14401440
HANDLE cons;
14411441
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;
14431444

14441445
do_unset_environment_variables();
14451446

0 commit comments

Comments
 (0)