summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2014-12-13 14:22:58 -0500
committerRich Felker <dalias@aerifal.cx>2014-12-13 14:22:58 -0500
commitda16224fc5fea45b307d9f0565c2adc92f9e1da0 (patch)
tree5202ec5c964ff65bd249fcb484a27a2c5c7a5243
parent567cc81c7e3f38c3ca9b223f5d771205711b1f5c (diff)
downloadmusl-da16224fc5fea45b307d9f0565c2adc92f9e1da0.tar.gz
simplify getopt_long argv permutation loop logic
-rw-r--r--src/misc/getopt_long.c4
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;
}