aboutsummaryrefslogtreecommitdiff
path: root/bin/sh
diff options
context:
space:
mode:
authorMartin Cracauer <cracauer@FreeBSD.org>2003-12-28 02:05:12 +0000
committerMartin Cracauer <cracauer@FreeBSD.org>2003-12-28 02:05:12 +0000
commitbd80d26f3b2fc205d7351ec17e029625f915a687 (patch)
tree0d471e13dfc235ee10f22f987870187f57a1b9ff /bin/sh
parent5caf2b00f0d473b1370a7fbbbd11cf9cd3be1a82 (diff)
downloadsrc-bd80d26f3b2fc205d7351ec17e029625f915a687.tar.gz
src-bd80d26f3b2fc205d7351ec17e029625f915a687.zip
Notes
Diffstat (limited to 'bin/sh')
-rw-r--r--bin/sh/eval.c25
1 files changed, 1 insertions, 24 deletions
diff --git a/bin/sh/eval.c b/bin/sh/eval.c
index 412f65092e13..aab2a53a11a1 100644
--- a/bin/sh/eval.c
+++ b/bin/sh/eval.c
@@ -205,7 +205,6 @@ evaltree(union node *n, int flags)
case NAND:
evaltree(n->nbinary.ch1, EV_TESTED);
if (evalskip || exitstatus != 0) {
- flags |= EV_TESTED;
goto out;
}
evaltree(n->nbinary.ch2, flags);
@@ -246,25 +245,9 @@ evaltree(union node *n, int flags)
break;
case NFOR:
evalfor(n);
- /*
- * The 'for' command does not set exitstatus, so the value
- * now in exitstatus is from the last command executed in
- * the 'for' loop. That exit value had been tested (wrt
- * 'sh -e' checking) while processing that command, and
- * it should not be re-tested here.
- */
- flags |= EV_TESTED;
break;
case NCASE:
evalcase(n, flags);
- /*
- * The 'case' command does not set exitstatus, so the value
- * now in exitstatus is from the last command executed in
- * the 'case' block. That exit value had been tested (wrt
- * 'sh -e' checking) while processing that command, and
- * it should not be re-tested here.
- */
- flags |= EV_TESTED;
break;
case NDEFUN:
defun(n->narg.text, n->narg.next);
@@ -289,14 +272,8 @@ evaltree(union node *n, int flags)
out:
if (pendingsigs)
dotrap();
- /*
- * XXX - Like "!(n->type == NSEMI)", more types will probably
- * need to be excluded from this test. It's probably better
- * to set or unset EV_TESTED in the loop above than to bloat
- * the conditional here.
- */
if ((flags & EV_EXIT) || (eflag && exitstatus
- && !(flags & EV_TESTED) && !(n->type == NSEMI)))
+ && !(flags & EV_TESTED) && (n->type == NCMD)))
exitshell(exitstatus);
}