summaryrefslogtreecommitdiff
path: root/src/linux/getopt_long.c
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2011-04-13 14:52:23 -0400
committerRich Felker <dalias@aerifal.cx>2011-04-13 14:52:23 -0400
commit6f0259a4fc7d827db027fe122377687ef780e17c (patch)
tree5c57baead1f656186cecd0a8303e381d4d846a13 /src/linux/getopt_long.c
parent45a3219944f03ece5742b6aecb79b6dc7c9ac0bb (diff)
downloadmusl-6f0259a4fc7d827db027fe122377687ef780e17c.tar.gz
musl-6f0259a4fc7d827db027fe122377687ef780e17c.tar.bz2
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.c2
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;