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 c3593716389c984d9200f63704f97b3cfaff876d..df2083bb26dd50404fa1aaaec45adab3d3e5417c 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;
        }