aboutsummaryrefslogtreecommitdiff
path: root/contrib/bmake/compat.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/bmake/compat.c')
-rw-r--r--contrib/bmake/compat.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/contrib/bmake/compat.c b/contrib/bmake/compat.c
index 8f931cbdc48d..b0bbc936f595 100644
--- a/contrib/bmake/compat.c
+++ b/contrib/bmake/compat.c
@@ -1,4 +1,4 @@
-/* $NetBSD: compat.c,v 1.91 2013/01/25 02:01:10 sjg Exp $ */
+/* $NetBSD: compat.c,v 1.93 2013/09/02 19:26:42 sjg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -70,14 +70,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: compat.c,v 1.91 2013/01/25 02:01:10 sjg Exp $";
+static char rcsid[] = "$NetBSD: compat.c,v 1.93 2013/09/02 19:26:42 sjg Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)compat.c 8.2 (Berkeley) 3/19/94";
#else
-__RCSID("$NetBSD: compat.c,v 1.91 2013/01/25 02:01:10 sjg Exp $");
+__RCSID("$NetBSD: compat.c,v 1.93 2013/09/02 19:26:42 sjg Exp $");
#endif
#endif /* not lint */
#endif
@@ -332,18 +332,23 @@ again:
* We need to pass the command off to the shell, typically
* because the command contains a "meta" character.
*/
- static const char *shargv[4];
+ static const char *shargv[5];
+ int shargc;
- shargv[0] = shellPath;
+ shargc = 0;
+ shargv[shargc++] = shellPath;
/*
* The following work for any of the builtin shell specs.
*/
+ if (errCheck && shellErrFlag) {
+ shargv[shargc++] = shellErrFlag;
+ }
if (DEBUG(SHELL))
- shargv[1] = "-xc";
+ shargv[shargc++] = "-xc";
else
- shargv[1] = "-c";
- shargv[2] = cmd;
- shargv[3] = NULL;
+ shargv[shargc++] = "-c";
+ shargv[shargc++] = cmd;
+ shargv[shargc++] = NULL;
av = shargv;
argc = 0;
bp = NULL;