aboutsummaryrefslogtreecommitdiff
path: root/util-linux
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-01-28 22:57:10 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-01-28 22:57:10 +0000
commit9772816570f0a63ac301f1885292b064e23f5310 (patch)
treea8e9c2947cd4dbc718989d508dfc742840a16e81 /util-linux
parent73032ca04be49c096f745f0873d67d9c831642bd (diff)
downloadbusybox-w32-9772816570f0a63ac301f1885292b064e23f5310.tar.gz
busybox-w32-9772816570f0a63ac301f1885292b064e23f5310.tar.bz2
busybox-w32-9772816570f0a63ac301f1885292b064e23f5310.zip
*: move getopt reset code to better place(s)
Diffstat (limited to 'util-linux')
-rw-r--r--util-linux/getopt.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/util-linux/getopt.c b/util-linux/getopt.c
index 061750e77..ee6c14393 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
155 155
156 if (quiet_errors) /* No error reporting from getopt(3) */ 156 if (quiet_errors) /* No error reporting from getopt(3) */
157 opterr = 0; 157 opterr = 0;
158 optind = 0; /* Reset getopt(3) */ 158
159 /* Reset getopt(3) (see libbb/getopt32.c for long rant) */
160#ifdef __GLIBC__
161 optind = 0;
162#else /* BSD style */
163 optind = 1;
164 /* optreset = 1; */
165#endif
159 166
160 while (1) { 167 while (1) {
161 opt = 168 opt =