aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGarance A Drosehn <gad@FreeBSD.org>2001-06-01 00:07:09 +0000
committerGarance A Drosehn <gad@FreeBSD.org>2001-06-01 00:07:09 +0000
commit0a315e79dfd60fb6c8c449b056b9558ae4611d65 (patch)
tree5bc2cca3c661b637fd5d8f73a9c1f68848704373
parentc6c87f2a180b8c8131ba75f56576dd3d99d584bd (diff)
Notes
-rw-r--r--bin/sh/eval.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/bin/sh/eval.c b/bin/sh/eval.c
index 8bf2d84522d6f..3ea2626a3b865 100644
--- a/bin/sh/eval.c
+++ b/bin/sh/eval.c
@@ -249,9 +249,25 @@ evaltree(n, 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);