diff options
author | jilles <jilles@FreeBSD.org> | 2011-11-20 21:48:50 +0000 |
---|---|---|
committer | jilles <jilles@FreeBSD.org> | 2011-11-20 21:48:50 +0000 |
commit | 1018bfcafa1ffa3a59e5bdd4b957a0282afc2f12 (patch) | |
tree | fb3cfbbb7119330e418d411dac19dde88b90c1bd /bin | |
parent | d19e8d9a37f12e934f0fd8d4803dfa41b596be32 (diff) | |
download | FreeBSD-src-1018bfcafa1ffa3a59e5bdd4b957a0282afc2f12.zip FreeBSD-src-1018bfcafa1ffa3a59e5bdd4b957a0282afc2f12.tar.gz |
sh: Allow unsetting OPTIND.
Note that only assigning the decimal value 1 resets getopts, as before.
Diffstat (limited to 'bin')
-rw-r--r-- | bin/sh/options.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/bin/sh/options.c b/bin/sh/options.c index 9104e93..4c2c8ab 100644 --- a/bin/sh/options.c +++ b/bin/sh/options.c @@ -401,9 +401,10 @@ setcmd(int argc, char **argv) void getoptsreset(const char *value) { - if (number(value) == 1) { + while (*value == '0') + value++; + if (strcmp(value, "1") == 0) shellparam.reset = 1; - } } /* |