projects
/
oweals
/
busybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4c9e9c4
)
getopt: reinstate erroneously removed getopt() reset code.
author
Denis Vlasenko
<vda.linux@googlemail.com>
Tue, 21 Oct 2008 12:36:43 +0000
(12:36 -0000)
committer
Denis Vlasenko
<vda.linux@googlemail.com>
Tue, 21 Oct 2008 12:36:43 +0000
(12:36 -0000)
util-linux/getopt.c
patch
|
blob
|
history
diff --git
a/util-linux/getopt.c
b/util-linux/getopt.c
index 8b5e46c7b57e0ee4533ef701be8ef0f69194d6ac..fd6728731ec2695dbcee7e67577a4feef2731938 100644
(file)
--- 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
if (quiet_errors) /* No error reporting from getopt(3) */
opterr = 0;
+ /* We used it already in main() in getopt32(),
+ * we *must* reset getopt(3): */
+#ifdef __GLIBC__
+ optind = 0;
+#else /* BSD style */
+ optind = 1;
+ /* optreset = 1; */
+#endif
+
while (1) {
opt =
#if ENABLE_GETOPT_LONG