diff options
author | Peter S. Mazinger <ps.m@gmx.net> | 2006-03-03 21:15:02 +0000 |
---|---|---|
committer | Peter S. Mazinger <ps.m@gmx.net> | 2006-03-03 21:15:02 +0000 |
commit | 2fb90be2fc519af1f18bb94f1b0ee54d49bd3ab8 (patch) | |
tree | d33ded5b1b38785fa44d3056cca46323f004d408 | |
parent | f8194a24c53f59594441830b692fae68e354076c (diff) |
Upstream update
-rw-r--r-- | libc/unistd/getopt_long-susv3.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libc/unistd/getopt_long-susv3.c b/libc/unistd/getopt_long-susv3.c index 9bae3d845..2dae341a3 100644 --- a/libc/unistd/getopt_long-susv3.c +++ b/libc/unistd/getopt_long-susv3.c @@ -17,11 +17,11 @@ static int __getopt_long(int argc, char *const *argv, const char *optstring, con (argv[optind][1] == '-' && argv[optind][2])) { int i; - char *opt = argv[optind]+2; for (i=0; longopts[i].name; i++) { const char *name = longopts[i].name; + char *opt = argv[optind]+2; while (*name && *name++ == *opt++); - if (*name && *opt != '=') continue; + if (*name || (*opt && *opt != '=')) continue; if (*opt == '=') { if (!longopts[i].has_arg) continue; optarg = opt+1; |