diff options
| author | Junio C Hamano <gitster@pobox.com> | 2012-04-16 12:42:54 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2012-04-16 12:42:55 -0700 |
| commit | fa0ba729dc5e0af0b0165e4e12904bfa3f39f9db (patch) | |
| tree | dc71f101ad7740d4f65a1db19270fbc97b9cad64 /run-command.c | |
| parent | 0f3ddd4a3abe863fae9c36ec4311ac936a2d8ed9 (diff) | |
| parent | b3e34dddc0d385dbcf6ea28bd8d4f5cba9c06f04 (diff) | |
| download | git-fa0ba729dc5e0af0b0165e4e12904bfa3f39f9db.tar.xz | |
Merge branch 'bw/spawn-via-shell-path'
"sh" on the user's PATH may be utterly broken on some systems;
consistently use SHELL_PATH even from inside run-command API.
By Ben Walton
* bw/spawn-via-shell-path:
Use SHELL_PATH from build system in run_command.c:prepare_shell_cmd
Diffstat (limited to 'run-command.c')
| -rw-r--r-- | run-command.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/run-command.c b/run-command.c index 1db8abf984..2af3e0fa52 100644 --- a/run-command.c +++ b/run-command.c @@ -4,6 +4,10 @@ #include "sigchain.h" #include "argv-array.h" +#ifndef SHELL_PATH +# define SHELL_PATH "/bin/sh" +#endif + struct child_to_clean { pid_t pid; struct child_to_clean *next; @@ -90,7 +94,7 @@ static const char **prepare_shell_cmd(const char **argv) die("BUG: shell command is empty"); if (strcspn(argv[0], "|&;<>()$`\\\"' \t\n*?[#~=%") != strlen(argv[0])) { - nargv[nargc++] = "sh"; + nargv[nargc++] = SHELL_PATH; nargv[nargc++] = "-c"; if (argc < 2) |
