Fix ';' command when used with -e flag.

PR:		bin/14509
This commit is contained in:
Martin Cracauer 1999-10-26 13:17:18 +00:00
parent 021823c35c
commit 905f2e447b

View File

@ -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);
}