projects
/
oweals
/
musl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
45a3219
)
fix bug whereby getopt_long allowed mismatch in last char of option name
author
Rich Felker
<dalias@aerifal.cx>
Wed, 13 Apr 2011 18:52:23 +0000
(14:52 -0400)
committer
Rich Felker
<dalias@aerifal.cx>
Wed, 13 Apr 2011 18:52:23 +0000
(14:52 -0400)
src/linux/getopt_long.c
patch
|
blob
|
history
diff --git
a/src/linux/getopt_long.c
b/src/linux/getopt_long.c
index d80cd1b67d2042e88607846ecb075bc17c6e6cff..6d3a4a6e644e5dc4ba3156ba3a7ce4a0c006c9cb 100644
(file)
--- a/
src/linux/getopt_long.c
+++ b/
src/linux/getopt_long.c
@@
-14,7
+14,7
@@
static int __getopt_long(int argc, char *const *argv, const char *optstring, con
const char *name = longopts[i].name;
char *opt = argv[optind]+1;
if (*opt == '-') opt++;
-
while (*name && *name++ == *
opt++);
+
for (; *name && *name == *opt; name++,
opt++);
if (*name || (*opt && *opt != '=')) continue;
if (*opt == '=') {
if (!longopts[i].has_arg) continue;