sh: Recognize "--" as end of options in local builtin.
This commit is contained in:
parent
1201f3dac8
commit
c71191e0d9
@ -710,6 +710,7 @@ localcmd(int argc __unused, char **argv __unused)
|
||||
{
|
||||
char *name;
|
||||
|
||||
nextopt("");
|
||||
if (! in_function())
|
||||
error("Not in a function");
|
||||
while ((name = *argptr++) != NULL) {
|
||||
|
12
tools/regression/bin/sh/builtins/local4.0
Normal file
12
tools/regression/bin/sh/builtins/local4.0
Normal file
@ -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
|
Loading…
Reference in New Issue
Block a user