diff options
author | Denis Vlasenko | 2008-01-28 22:57:10 +0000 |
---|---|---|
committer | Denis Vlasenko | 2008-01-28 22:57:10 +0000 |
commit | 9772816570f0a63ac301f1885292b064e23f5310 (patch) | |
tree | a8e9c2947cd4dbc718989d508dfc742840a16e81 /util-linux/getopt.c | |
parent | 73032ca04be49c096f745f0873d67d9c831642bd (diff) | |
download | busybox-9772816570f0a63ac301f1885292b064e23f5310.zip busybox-9772816570f0a63ac301f1885292b064e23f5310.tar.gz |
*: move getopt reset code to better place(s)
Diffstat (limited to 'util-linux/getopt.c')
-rw-r--r-- | util-linux/getopt.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/util-linux/getopt.c b/util-linux/getopt.c index 061750e..ee6c143 100644 --- a/util-linux/getopt.c +++ b/util-linux/getopt.c @@ -155,7 +155,14 @@ static int generate_output(char **argv, int argc, const char *optstr, const stru if (quiet_errors) /* No error reporting from getopt(3) */ opterr = 0; - optind = 0; /* Reset getopt(3) */ + + /* Reset getopt(3) (see libbb/getopt32.c for long rant) */ +#ifdef __GLIBC__ + optind = 0; +#else /* BSD style */ + optind = 1; + /* optreset = 1; */ +#endif while (1) { opt = |