summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2007-09-17 10:33:29 +0000
committerMarc Espie <espie@cvs.openbsd.org>2007-09-17 10:33:29 +0000
commit53981fd98c36ade41c61af0c7ce1101d36b3fe43 (patch)
tree5b7dbbd59204f37143a6c764db33a86d7fea5803 /usr.bin
parent947847efe3ace9c6d34fa10992c6335b2150eaaa (diff)
we have valid err/echo flags
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/make/job.c39
1 files changed, 9 insertions, 30 deletions
diff --git a/usr.bin/make/job.c b/usr.bin/make/job.c
index b8a3440f980..db39d9531ec 100644
--- a/usr.bin/make/job.c
+++ b/usr.bin/make/job.c
@@ -1,5 +1,5 @@
/* $OpenPackages$ */
-/* $OpenBSD: job.c,v 1.72 2007/09/17 10:31:13 espie Exp $ */
+/* $OpenBSD: job.c,v 1.73 2007/09/17 10:33:28 espie Exp $ */
/* $NetBSD: job.c,v 1.16 1996/11/06 17:59:08 christos Exp $ */
/*
@@ -1248,35 +1248,14 @@ JobMakeArgv(Job *job, char **argv)
argv[0] = (char *)shellName;
argc = 1;
- if ((commandShell->exit && *commandShell->exit != '-') ||
- (commandShell->echo && *commandShell->echo != '-')) {
- /*
- * At least one of the flags doesn't have a minus before it, so
- * merge them together. Have to do this because the
- * *(&(@*#*&#$# Bourne shell thinks its second argument is a
- * file to source. Grrrr. Note the ten-character limitation on
- * the combined arguments.
- */
- (void)snprintf(args, sizeof(args), "-%s%s",
- ((job->flags & JOB_IGNERR) ? "" :
- (commandShell->exit ? commandShell->exit : "")),
- ((job->flags & JOB_SILENT) ? "" :
- (commandShell->echo ? commandShell->echo : "")));
-
- if (args[1]) {
- argv[argc] = args;
- argc++;
- }
- } else {
- if (!(job->flags & JOB_IGNERR) && commandShell->exit) {
- argv[argc] = commandShell->exit;
- argc++;
- }
- if (!(job->flags & JOB_SILENT) && commandShell->echo) {
- argv[argc] = commandShell->echo;
- argc++;
- }
- }
+ (void)snprintf(args, sizeof(args), "-%s%s",
+ (job->flags & JOB_IGNERR) ? "" : SHELL_ERROR_FLAG,
+ (job->flags & JOB_SILENT) ? "" : SHELL_ECHO_FLAG);
+
+ if (args[1]) {
+ argv[argc] = args;
+ argc++;
+ }
argv[argc] = NULL;
}