svn commit: r254339 - in head: bin/sh tools/regression/bin/sh/builtins
Jilles Tjoelker
jilles at FreeBSD.org
Wed Aug 14 21:59:48 UTC 2013
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
More information about the svn-src-head
mailing list