Date: Sat, 11 Sep 2010 15:07:40 +0000 (UTC) From: Jilles Tjoelker <jilles@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r212475 - in head: bin/sh tools/regression/bin/sh/builtins Message-ID: <201009111507.o8BF7e0k008368@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201009111507.o8BF7e0k008368>