commit | 9772816570f0a63ac301f1885292b064e23f5310 | [log] [tgz] |
---|---|---|
author | Denis Vlasenko <vda.linux@googlemail.com> | Mon Jan 28 22:57:10 2008 +0000 |
committer | Denis Vlasenko <vda.linux@googlemail.com> | Mon Jan 28 22:57:10 2008 +0000 |
tree | a8e9c2947cd4dbc718989d508dfc742840a16e81 | |
parent | 73032ca04be49c096f745f0873d67d9c831642bd [diff] [blame] |
*: move getopt reset code to better place(s)
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 @@ 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 =