diff options
author | Rich Felker <dalias@aerifal.cx> | 2014-12-13 14:22:58 -0500 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2014-12-13 14:22:58 -0500 |
commit | da16224fc5fea45b307d9f0565c2adc92f9e1da0 (patch) | |
tree | 5202ec5c964ff65bd249fcb484a27a2c5c7a5243 /src/misc/getopt_long.c | |
parent | 567cc81c7e3f38c3ca9b223f5d771205711b1f5c (diff) | |
download | musl-da16224fc5fea45b307d9f0565c2adc92f9e1da0.tar.gz |
simplify getopt_long argv permutation loop logic
Diffstat (limited to 'src/misc/getopt_long.c')
-rw-r--r-- | src/misc/getopt_long.c | 4 |
1 files changed, 1 insertions, 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; } |