diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2016-12-11 17:37:39 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2016-12-11 17:37:39 +0000 |
commit | bce3e8542f5089a9365ce80a473da18dac4650d1 (patch) | |
tree | ad76c250d7a878735ed36abba793f6822ef2ce72 /bin | |
parent | 23c7734ad5c8441df1803104210b3334746ff131 (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.c | 11 |
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); |