Fix $? at the first command of a function. The previous exit status was saved

twice and thus lost.
This commit is contained in:
stefanf 2008-11-23 20:23:57 +00:00
parent 954a204664
commit fd291bd5c3

View File

@ -791,6 +791,7 @@ evalcommand(union node *cmd, int flags, struct backcmd *backcmd)
for (sp = varlist.list ; sp ; sp = sp->next)
mklocal(sp->text);
funcnest++;
exitstatus = oexitstatus;
if (flags & EV_TESTED)
evaltree(cmdentry.u.func, EV_TESTED);
else