From: Rich Felker Date: Wed, 13 Apr 2011 18:52:23 +0000 (-0400) Subject: fix bug whereby getopt_long allowed mismatch in last char of option name X-Git-Tag: v0.7.9~62 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=6f0259a4fc7d827db027fe122377687ef780e17c;p=oweals%2Fmusl.git fix bug whereby getopt_long allowed mismatch in last char of option name --- 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;