summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorstefanf <stefanf@FreeBSD.org>2005-09-10 08:19:58 +0000
committerstefanf <stefanf@FreeBSD.org>2005-09-10 08:19:58 +0000
commit2485a74343577b25f8e4fdb207039372ba58d9fa (patch)
tree1aba65323d9101fe135a460a0e513a4b84fae6cc /bin
parent4ca45af625a09977cd8bfe7b0a129ed3c3e22f06 (diff)
downloadFreeBSD-src-2485a74343577b25f8e4fdb207039372ba58d9fa.zip
FreeBSD-src-2485a74343577b25f8e4fdb207039372ba58d9fa.tar.gz
Pass the EV_TESTED flag to the left operand of NSEMI nodes. This fixes
two cases of unwanted termination with set -e: * if-commands containing several commands separated by semicolons, eg if false; false; then [...] * functions with an explicitely tested exit status that contain a failing command which is not the last one, eg f() { false false } f || true PR: 77067, 85267 Briefly reviewed by: cracauer
Diffstat (limited to 'bin')
-rw-r--r--bin/sh/eval.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/bin/sh/eval.c b/bin/sh/eval.c
index a91f9db..ada2a78 100644
--- a/bin/sh/eval.c
+++ b/bin/sh/eval.c
@@ -196,7 +196,7 @@ evaltree(union node *n, int flags)
TRACE(("evaltree(%p: %d) called\n", (void *)n, n->type));
switch (n->type) {
case NSEMI:
- evaltree(n->nbinary.ch1, 0);
+ evaltree(n->nbinary.ch1, flags & ~EV_EXIT);
if (evalskip)
goto out;
evaltree(n->nbinary.ch2, flags);
OpenPOWER on IntegriCloud