simplify getopt_long argv permutation loop logic
authorRich Felker <dalias@aerifal.cx>
Sat, 13 Dec 2014 19:22:58 +0000 (14:22 -0500)
committerRich Felker <dalias@aerifal.cx>
Sat, 13 Dec 2014 19:22:58 +0000 (14:22 -0500)
src/misc/getopt_long.c

index c359371..df2083b 100644 (file)
@@ -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;
        }