summary refs log tree commit diff
path: root/src/funcs/kill
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2013-08-23 21:27:42 +1000
committerHerbert Xu <herbert@gondor.apana.org.au>2013-08-23 21:27:42 +1000
commita14c418aee9d4ccd7cf888024e318b300173099f (patch)
tree6d767ed945497fc9653b86a68461620d8d5308ae /src/funcs/kill
parent[VAR] Add newline when tracing in poplocalvars (diff)
downloaddash-a14c418aee9d4ccd7cf888024e318b300173099f.tar.gz
dash-a14c418aee9d4ccd7cf888024e318b300173099f.zip
[VAR] Initialise OPTIND after importing environment
On Sat, Mar 23, 2013 at 01:46:20AM +0000, Chris F.A. Johnson wrote:
> 
>   According to both the dash man page and the POSIX spec, "When the
>   shell is invoked, OPTIND is initialized to 1."
> 
>   However, it actually takes the value of the environment variable
>   if it exists:
> 
> $ OPTIND=4 dash -c 'echo "$OPTIND"'
> 4
> $ OPTIND=4 bash -c 'echo "$OPTIND"'
> 1
> $ OPTIND=4 ksh -c 'echo "$OPTIND"'
> 1
> $ OPTIND=4 ksh93 -c 'echo "$OPTIND"'
> 1

This patch fixes this by initialising OPTIND after importing the
environment.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to '')
0 files changed, 0 insertions, 0 deletions
d>Add license header to cgit CSSJune McEnroe 2019-12-22Add The Book of EttaJune McEnroe 2019-12-21Revert "Add first working version of imbox"June McEnroe 2019-12-21Add first working version of imboxJune McEnroe 2019-12-20Respect mailmap in gl pretty formatJune McEnroe 2019-12-20Set LANG in cgit filtersJune McEnroe 2019-12-20Source .editrc before applying -v or -eJune McEnroe 2019-12-20Disable signing commitsJune McEnroe 2019-12-19Ignore about-filterJune McEnroe 2019-12-19Fix matching make tags with no sourcesJune McEnroe 2019-12-19Avoid matching := assignments as tagsJune McEnroe 2019-12-18Hide line numbers when rendering mdocJune McEnroe 2019-12-18Customize cgit CSSJune McEnroe 2019-12-18Use :target rather than :focus pseudo-classJune McEnroe 2019-12-18Copy cgit auxiliary binaries properlyJune McEnroe 2019-12-18Add git.causal.agency cgit configJune McEnroe 2019-12-18Bail from hi if input is binaryJune McEnroe 2019-12-16Post "cgit setup"June McEnroe