svn commit: r185231 - head/bin/sh

Stefan Farfeleder stefanf at FreeBSD.org
Sun Nov 23 12:23:58 PST 2008


Author: stefanf
Date: Sun Nov 23 20:23:57 2008
New Revision: 185231
URL: http://svn.freebsd.org/changeset/base/185231

Log:
  Fix $? at the first command of a function.  The previous exit status was saved
  twice and thus lost.

Modified:
  head/bin/sh/eval.c

Modified: head/bin/sh/eval.c
==============================================================================
--- head/bin/sh/eval.c	Sun Nov 23 20:19:35 2008	(r185230)
+++ head/bin/sh/eval.c	Sun Nov 23 20:23:57 2008	(r185231)
@@ -791,6 +791,7 @@ evalcommand(union node *cmd, int flags, 
 		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


More information about the svn-src-all mailing list