From da16224fc5fea45b307d9f0565c2adc92f9e1da0 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Sat, 13 Dec 2014 14:22:58 -0500 Subject: [PATCH] simplify getopt_long argv permutation loop logic --- src/misc/getopt_long.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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; } -- 2.25.1