summaryrefslogtreecommitdiff
path: root/libc/unistd/getopt_long-susv3.c
diff options
context:
space:
mode:
authorPeter S. Mazinger <ps.m@gmx.net>2006-03-03 21:15:02 +0000
committerPeter S. Mazinger <ps.m@gmx.net>2006-03-03 21:15:02 +0000
commit2fb90be2fc519af1f18bb94f1b0ee54d49bd3ab8 (patch)
treed33ded5b1b38785fa44d3056cca46323f004d408 /libc/unistd/getopt_long-susv3.c
parentf8194a24c53f59594441830b692fae68e354076c (diff)
Upstream update
Diffstat (limited to 'libc/unistd/getopt_long-susv3.c')
-rw-r--r--libc/unistd/getopt_long-susv3.c4
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;