]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
sh: Recognize "--" in . and exec.
authorJilles Tjoelker <jilles@FreeBSD.org>
Fri, 28 May 2010 22:40:24 +0000 (22:40 +0000)
committerJilles Tjoelker <jilles@FreeBSD.org>
Fri, 28 May 2010 22:40:24 +0000 (22:40 +0000)
commitc1564db05dc96d845d91303cecf4e6173764bd7c
tree5a790475e2c817e156e002a6faead7c8f13cc265
parentbc4c1a06701177bdd3180f28a2084952cf5e4ab4
sh: Recognize "--" in . and exec.

Although "--" historically has not been required to be recognized for
certain special builtins that do not take options in POSIX, some other
implementations recognize options for them, requiring scripts to use "--" or
avoid operands starting with "-".

Operands starting with "-" can be avoided with eval by prepending a space,
and cannot occur with break, continue, exit, return and shift as they only
take numbers, nor with times as it does not take operands. With . and exec,
avoiding "-" is not so easy as it may require reimplementing the PATH
search; therefore the current proposal for POSIX is to require recognition
of "--" for them.

We continue to accept other strings starting with "-" as operands to . and
exec, and also "--" if it is alone to . (which would otherwise be invalid
anyway).
bin/sh/eval.c
bin/sh/main.c
tools/regression/bin/sh/builtins/dot2.0 [new file with mode: 0644]
tools/regression/bin/sh/builtins/exec2.0 [new file with mode: 0644]