Fix $? at the first command of a function. The previous exit status was saved
twice and thus lost.
This commit is contained in:
parent
1f925d9161
commit
94c53a0811
@ -791,6 +791,7 @@ evalcommand(union node *cmd, int flags, struct backcmd *backcmd)
|
|||||||
for (sp = varlist.list ; sp ; sp = sp->next)
|
for (sp = varlist.list ; sp ; sp = sp->next)
|
||||||
mklocal(sp->text);
|
mklocal(sp->text);
|
||||||
funcnest++;
|
funcnest++;
|
||||||
|
exitstatus = oexitstatus;
|
||||||
if (flags & EV_TESTED)
|
if (flags & EV_TESTED)
|
||||||
evaltree(cmdentry.u.func, EV_TESTED);
|
evaltree(cmdentry.u.func, EV_TESTED);
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user