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
This commit is contained in:
parent
71270ca60b
commit
2340828b1e
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user