Date: Wed, 14 Aug 2013 21:59:48 +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: r254339 - in head: bin/sh tools/regression/bin/sh/builtins Message-ID: <201308142159.r7ELxmhi063416@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jilles Date: Wed Aug 14 21:59:48 2013 New Revision: 254339 URL: http://svnweb.freebsd.org/changeset/base/254339 Log: sh: Recognize "--" as end of options in local builtin. Added: head/tools/regression/bin/sh/builtins/local4.0 (contents, props changed) Modified: head/bin/sh/var.c Modified: head/bin/sh/var.c ============================================================================== --- head/bin/sh/var.c Wed Aug 14 21:51:32 2013 (r254338) +++ head/bin/sh/var.c Wed Aug 14 21:59:48 2013 (r254339) @@ -710,6 +710,7 @@ localcmd(int argc __unused, char **argv { char *name; + nextopt(""); if (! in_function()) error("Not in a function"); while ((name = *argptr++) != NULL) { Added: head/tools/regression/bin/sh/builtins/local4.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/builtins/local4.0 Wed Aug 14 21:59:48 2013 (r254339) @@ -0,0 +1,12 @@ +# $FreeBSD$ + +f() { + local -- x + x=2 + [ "$x" = 2 ] +} +x=1 +f || exit 3 +[ "$x" = 1 ] || exit 3 +f || exit 3 +[ "$x" = 1 ] || exit 3
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201308142159.r7ELxmhi063416>