From owner-svn-src-head@FreeBSD.ORG Sun Nov 23 20:23:58 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 250181065675; Sun, 23 Nov 2008 20:23:58 +0000 (UTC) (envelope-from stefanf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 127CC8FC26; Sun, 23 Nov 2008 20:23:58 +0000 (UTC) (envelope-from stefanf@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mANKNvaX063434; Sun, 23 Nov 2008 20:23:57 GMT (envelope-from stefanf@svn.freebsd.org) Received: (from stefanf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mANKNv1B063433; Sun, 23 Nov 2008 20:23:57 GMT (envelope-from stefanf@svn.freebsd.org) Message-Id: <200811232023.mANKNv1B063433@svn.freebsd.org> From: Stefan Farfeleder Date: Sun, 23 Nov 2008 20:23:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185231 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Nov 2008 20:23:58 -0000 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