From: Rich Felker Date: Sat, 13 Dec 2014 19:22:58 +0000 (-0500) Subject: simplify getopt_long argv permutation loop logic X-Git-Tag: v1.1.6~29 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=da16224fc5fea45b307d9f0565c2adc92f9e1da0;p=oweals%2Fmusl.git simplify getopt_long argv permutation loop logic --- diff --git a/src/misc/getopt_long.c b/src/misc/getopt_long.c index c3593716..df2083bb 100644 --- a/src/misc/getopt_long.c +++ b/src/misc/getopt_long.c @@ -31,9 +31,7 @@ static int __getopt_long(int argc, char *const *argv, const char *optstring, con int i; for (i=optind; ; i++) { if (i >= argc || !argv[i]) return -1; - if (argv[i][0] != '-') continue; - if (!argv[i][1]) continue; - break; + if (argv[i][0] == '-' && argv[i][1]) break; } optind = i; }