From fd291bd5c3f1eba1fe1eb9a64380dedaffafb8fe Mon Sep 17 00:00:00 2001 From: stefanf Date: Sun, 23 Nov 2008 20:23:57 +0000 Subject: Fix $? at the first command of a function. The previous exit status was saved twice and thus lost. --- bin/sh/eval.c | 1 + 1 file changed, 1 insertion(+) (limited to 'bin') diff --git a/bin/sh/eval.c b/bin/sh/eval.c index e1a3ce7..f6b702b 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 -- cgit v1.1