mirror of
https://github.com/git/git.git
synced 2026-01-18 06:34:21 +00:00
Merge branch 'spawn-with-spaces'
This change lets us spawn .bat scripts whose paths contain spaces. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
@@ -1597,7 +1597,9 @@ static pid_t mingw_spawnve_fd(const char *cmd, const char **argv, char **deltaen
|
||||
si.hStdError = winansi_get_osfhandle(fherr);
|
||||
|
||||
/* executables and the current directory don't support long paths */
|
||||
if (xutftowcs_path(wcmd, cmd) < 0)
|
||||
if (*argv && !strcmp(cmd, *argv))
|
||||
wcmd[0] = L'\0';
|
||||
else if (xutftowcs_path(wcmd, cmd) < 0)
|
||||
return -1;
|
||||
if (dir && xutftowcs_path(wdir, dir) < 0)
|
||||
return -1;
|
||||
@@ -1651,8 +1653,8 @@ static pid_t mingw_spawnve_fd(const char *cmd, const char **argv, char **deltaen
|
||||
wenvblk = make_environment_block(deltaenv);
|
||||
|
||||
memset(&pi, 0, sizeof(pi));
|
||||
ret = CreateProcessW(wcmd, wargs, NULL, NULL, TRUE, flags,
|
||||
wenvblk, dir ? wdir : NULL, &si, &pi);
|
||||
ret = CreateProcessW(*wcmd ? wcmd : NULL, wargs, NULL, NULL, TRUE,
|
||||
flags, wenvblk, dir ? wdir : NULL, &si, &pi);
|
||||
|
||||
free(wenvblk);
|
||||
free(wargs);
|
||||
|
||||
Reference in New Issue
Block a user