summaryrefslogtreecommitdiffstats
path: root/usr.bin/make/compat.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/make/compat.c')
-rw-r--r--usr.bin/make/compat.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.bin/make/compat.c b/usr.bin/make/compat.c
index 79531ef..b9ba32b 100644
--- a/usr.bin/make/compat.c
+++ b/usr.bin/make/compat.c
@@ -303,8 +303,9 @@ Compat_RunCommand (void *cmdp, void *gnp)
* -e flag as well as -c if it's supposed to exit when it hits an
* error.
*/
- static char *shargv[4] = { "/bin/sh" };
+ static char *shargv[4];
+ shargv[0] = shellPath;
shargv[1] = (errCheck ? "-ec" : "-c");
shargv[2] = cmd;
shargv[3] = (char *)NULL;
@@ -315,13 +316,14 @@ Compat_RunCommand (void *cmdp, void *gnp)
* This command must be passed by the shell for other reasons..
* or.. possibly not at all.
*/
- static char *shargv[4] = { "/bin/sh" };
+ static char *shargv[4];
if (internal == -1) {
/* Command does not need to be executed */
return (0);
}
+ shargv[0] = shellPath;
shargv[1] = (errCheck ? "-ec" : "-c");
shargv[2] = cmd;
shargv[3] = (char *)NULL;
@@ -655,6 +657,7 @@ Compat_Run(Lst targs)
int errors; /* Number of targets not remade due to errors */
CompatInit();
+ Shell_Init(); /* Set up shell. */
if (signal(SIGINT, SIG_IGN) != SIG_IGN) {
signal(SIGINT, CompatInterrupt);
OpenPOWER on IntegriCloud