diff options
author | cracauer <cracauer@FreeBSD.org> | 1999-10-26 13:17:18 +0000 |
---|---|---|
committer | cracauer <cracauer@FreeBSD.org> | 1999-10-26 13:17:18 +0000 |
commit | 71850b08e9154d14028166bfb40d7ac93d85391b (patch) | |
tree | fdf21031bb5ba754edf9e46beed0e346fda5c444 /bin | |
parent | 226fbf47146cb040a886724dee6ba4250518539e (diff) | |
download | FreeBSD-src-71850b08e9154d14028166bfb40d7ac93d85391b.zip FreeBSD-src-71850b08e9154d14028166bfb40d7ac93d85391b.tar.gz |
Fix ';' command when used with -e flag.
PR: bin/14509
Diffstat (limited to 'bin')
-rw-r--r-- | bin/sh/eval.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/bin/sh/eval.c b/bin/sh/eval.c index 341fbab..a3c8fcd 100644 --- a/bin/sh/eval.c +++ b/bin/sh/eval.c @@ -275,7 +275,14 @@ evaltree(n, flags) out: if (pendingsigs) dotrap(); - if ((flags & EV_EXIT) || (eflag && exitstatus && !(flags & EV_TESTED))) + /* + * 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))) exitshell(exitstatus); } |