summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2019-09-19 15:05:45 (GMT)
committerJohannes Schindelin <johannes.schindelin@gmx.de>2019-12-06 15:31:14 (GMT)
commit49f7a76d57c78e55f2f72e44664824f3fecb8837 (patch)
tree51c56a0280b9f8d0cf4986c5e492fd1a424d5559
parente2ba3d6f6d1c2b0e7e501ae01a0e839a6f537188 (diff)
downloadgit-49f7a76d57c78e55f2f72e44664824f3fecb8837.zip
git-49f7a76d57c78e55f2f72e44664824f3fecb8837.tar.gz
git-49f7a76d57c78e55f2f72e44664824f3fecb8837.tar.bz2
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>
-rw-r--r--compat/mingw.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/compat/mingw.c b/compat/mingw.c
index 5dbaae9..32fc02e 100644
--- a/compat/mingw.c
+++ b/compat/mingw.c
@@ -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();