diff options
author | Rich Felker <dalias@aerifal.cx> | 2011-04-13 14:52:23 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2011-04-13 14:52:23 -0400 |
commit | 6f0259a4fc7d827db027fe122377687ef780e17c (patch) | |
tree | 5c57baead1f656186cecd0a8303e381d4d846a13 /src/linux/getopt_long.c | |
parent | 45a3219944f03ece5742b6aecb79b6dc7c9ac0bb (diff) | |
download | musl-6f0259a4fc7d827db027fe122377687ef780e17c.tar.gz musl-6f0259a4fc7d827db027fe122377687ef780e17c.tar.xz musl-6f0259a4fc7d827db027fe122377687ef780e17c.zip |
fix bug whereby getopt_long allowed mismatch in last char of option name
Diffstat (limited to 'src/linux/getopt_long.c')
-rw-r--r-- | src/linux/getopt_long.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/linux/getopt_long.c b/src/linux/getopt_long.c index d80cd1b6..6d3a4a6e 100644 --- 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; |