mirror of
https://github.com/git/git.git
synced 2026-03-14 18:59:04 +01:00
Quote the script name before invoking the interpreter.
When the argument vector for the interpreter invocation is assembled, the original arguments were already quoted when necessary, but the script name was not. If the script lives in a directory whose names contains spaces, the interpreter would not find the script.
This commit is contained in:
@@ -279,7 +279,7 @@ static int try_shell_exec(const char *cmd, const char **argv, const char **env)
|
||||
for (n = 0; argv[n];) n++;
|
||||
sh_argv = xmalloc((n+2)*sizeof(char*));
|
||||
sh_argv[0] = interpr;
|
||||
sh_argv[1] = cmd;
|
||||
sh_argv[1] = quote_arg(cmd);
|
||||
quote_argv(&sh_argv[2], &argv[1]);
|
||||
n = spawnvpe(_P_WAIT, interpr, sh_argv, env);
|
||||
if (n == -1)
|
||||
|
||||
Reference in New Issue
Block a user