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:
Johannes Sixt
2007-04-13 09:53:43 +02:00
parent 5009b5450d
commit 390b6df11c

View File

@@ -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)