From owner-svn-src-all@FreeBSD.ORG Sat Sep 11 15:07:40 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A6E06106567A; Sat, 11 Sep 2010 15:07:40 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 95D7A8FC1A; Sat, 11 Sep 2010 15:07:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8BF7emZ008372; Sat, 11 Sep 2010 15:07:40 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8BF7e0k008368; Sat, 11 Sep 2010 15:07:40 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201009111507.o8BF7e0k008368@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 11 Sep 2010 15:07:40 +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: r212475 - in head: bin/sh tools/regression/bin/sh/builtins X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Sep 2010 15:07:40 -0000 Author: jilles Date: Sat Sep 11 15:07:40 2010 New Revision: 212475 URL: http://svn.freebsd.org/changeset/base/212475 Log: sh: Fix exit status if return is used within a loop condition. Added: head/tools/regression/bin/sh/builtins/return6.4 (contents, props changed) head/tools/regression/bin/sh/builtins/return7.4 (contents, props changed) Modified: head/bin/sh/eval.c Modified: head/bin/sh/eval.c ============================================================================== --- head/bin/sh/eval.c Sat Sep 11 14:46:19 2010 (r212474) +++ head/bin/sh/eval.c Sat Sep 11 15:07:40 2010 (r212475) @@ -305,6 +305,8 @@ skipping: if (evalskip == SKIPCONT && } if (evalskip == SKIPBREAK && --skipcount <= 0) evalskip = 0; + if (evalskip == SKIPFUNC || evalskip == SKIPFILE) + status = exitstatus; break; } if (n->type == NWHILE) { Added: head/tools/regression/bin/sh/builtins/return6.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/builtins/return6.4 Sat Sep 11 15:07:40 2010 (r212475) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +while return 4; do exit 3; done Added: head/tools/regression/bin/sh/builtins/return7.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/builtins/return7.4 Sat Sep 11 15:07:40 2010 (r212475) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +f() { + while return 4; do exit 3; done +} +f