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

twice and thus lost.
This commit is contained in:
Stefan Farfeleder 2008-11-23 20:23:57 +00:00
parent 1f925d9161
commit 94c53a0811
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=185231

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