diff --git a/bin/sh/eval.c b/bin/sh/eval.c index e1a3ce7cfe49..f6b702b3d2b0 100644 --- a/bin/sh/eval.c +++ b/bin/sh/eval.c @@ -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