summaryrefslogtreecommitdiff
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.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/usr.bin/make/compat.c b/usr.bin/make/compat.c
index ddbd32816dd..2df969be983 100644
--- a/usr.bin/make/compat.c
+++ b/usr.bin/make/compat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: compat.c,v 1.31 2000/06/23 16:21:43 espie Exp $ */
+/* $OpenBSD: compat.c,v 1.32 2000/06/30 23:26:25 espie Exp $ */
/* $NetBSD: compat.c,v 1.14 1996/11/06 17:59:01 christos Exp $ */
/*
@@ -43,7 +43,7 @@
#if 0
static char sccsid[] = "@(#)compat.c 8.2 (Berkeley) 3/19/94";
#else
-static char rcsid[] = "$OpenBSD: compat.c,v 1.31 2000/06/23 16:21:43 espie Exp $";
+static char rcsid[] = "$OpenBSD: compat.c,v 1.32 2000/06/30 23:26:25 espie Exp $";
#endif
#endif /* not lint */
@@ -206,7 +206,8 @@ CompatRunCommand (cmdp, gnp)
char *cmdStart; /* Start of expanded command */
char *cp, *bp = NULL;
Boolean silent, /* Don't print command */
- errCheck; /* Check errors */
+ errCheck, /* Check errors */
+ doExecute; /* Execute the command */
int reason; /* Reason for child's death */
int status; /* Description of child's death */
int cpid; /* Child actually found */
@@ -231,6 +232,7 @@ CompatRunCommand (cmdp, gnp)
#endif
silent = gn->type & OP_SILENT;
errCheck = !(gn->type & OP_IGNORE);
+ doExecute = !noExecute;
cmdNode = Lst_Member(&gn->commands, cmd);
cmdStart = Var_Subst(cmd, &gn->context, FALSE);
@@ -259,13 +261,15 @@ CompatRunCommand (cmdp, gnp)
return 1;
}
- while ((*cmd == '@') || (*cmd == '-')) {
- if (*cmd == '@') {
+ for (;; cmd++) {
+ if (*cmd == '@')
silent = TRUE;
- } else {
+ else if (*cmd == '-')
errCheck = FALSE;
- }
- cmd++;
+ else if (*cmd == '+')
+ doExecute = TRUE;
+ else
+ break;
}
while (isspace((unsigned char)*cmd))
@@ -293,7 +297,7 @@ CompatRunCommand (cmdp, gnp)
* If we're not supposed to execute any commands, this is as far as
* we go...
*/
- if (noExecute)
+ if (!doExecute)
return 1;
if (*cp != '\0') {