aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-10-21 12:36:43 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-10-21 12:36:43 +0000
commit7effd7ae99b2288452762f29cde8311ec72c2cb8 (patch)
tree5c6d4925605128728f426dd25d3ebab2ca7360bf
parent4c9e9c4314e6f997f37814fffc6b49ebd24bd6be (diff)
downloadbusybox-w32-7effd7ae99b2288452762f29cde8311ec72c2cb8.tar.gz
busybox-w32-7effd7ae99b2288452762f29cde8311ec72c2cb8.tar.bz2
busybox-w32-7effd7ae99b2288452762f29cde8311ec72c2cb8.zip
getopt: reinstate erroneously removed getopt() reset code.
-rw-r--r--util-linux/getopt.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/util-linux/getopt.c b/util-linux/getopt.c
index 8b5e46c7b..fd6728731 100644
--- a/util-linux/getopt.c
+++ b/util-linux/getopt.c
@@ -157,6 +157,15 @@ static int generate_output(char **argv, int argc, const char *optstr, const stru
157 if (quiet_errors) /* No error reporting from getopt(3) */ 157 if (quiet_errors) /* No error reporting from getopt(3) */
158 opterr = 0; 158 opterr = 0;
159 159
160 /* We used it already in main() in getopt32(),
161 * we *must* reset getopt(3): */
162#ifdef __GLIBC__
163 optind = 0;
164#else /* BSD style */
165 optind = 1;
166 /* optreset = 1; */
167#endif
168
160 while (1) { 169 while (1) {
161 opt = 170 opt =
162#if ENABLE_GETOPT_LONG 171#if ENABLE_GETOPT_LONG