summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2016-12-11 17:37:39 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2016-12-11 17:37:39 +0000
commitbce3e8542f5089a9365ce80a473da18dac4650d1 (patch)
treead76c250d7a878735ed36abba793f6822ef2ce72 /bin
parent23c7734ad5c8441df1803104210b3334746ff131 (diff)
In execute() we assign xerrorok to a dummy value if it is NULL
so there is no need to check xerrorok for NULL after that. From Kartik Agaram.
Diffstat (limited to 'bin')
-rw-r--r--bin/ksh/exec.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/bin/ksh/exec.c b/bin/ksh/exec.c
index 1d2f19a5c6a..3dc782c13d6 100644
--- a/bin/ksh/exec.c
+++ b/bin/ksh/exec.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: exec.c,v 1.65 2016/12/11 17:31:58 millert Exp $ */
+/* $OpenBSD: exec.c,v 1.66 2016/12/11 17:37:38 millert Exp $ */
/*
* execute command tree
@@ -240,16 +240,14 @@ execute(struct op *volatile t,
rv = execute(t->right, flags & XERROK, xerrok);
else {
flags |= XERROK;
- if (xerrok)
- *xerrok = 1;
+ *xerrok = 1;
}
break;
case TBANG:
rv = !execute(t->right, XERROK, xerrok);
flags |= XERROK;
- if (xerrok)
- *xerrok = 1;
+ *xerrok = 1;
break;
case TDBRACKET:
@@ -383,8 +381,7 @@ execute(struct op *volatile t,
quitenv(NULL); /* restores IO */
if ((flags&XEXEC))
unwind(LEXIT); /* exit child */
- if (rv != 0 && !(flags & XERROK) &&
- (xerrok == NULL || !*xerrok)) {
+ if (rv != 0 && !(flags & XERROK) && !*xerrok) {
trapsig(SIGERR_);
if (Flag(FERREXIT))
unwind(LERROR);