projects
/
oweals
/
musl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b4ef183
)
fix handling of "--" with getopt_long argv permutation
author
Rich Felker
<dalias@aerifal.cx>
Sat, 13 Dec 2014 06:04:21 +0000
(
01:04
-0500)
committer
Rich Felker
<dalias@aerifal.cx>
Sat, 13 Dec 2014 06:04:21 +0000
(
01:04
-0500)
if argv permutation is used, the option terminator "--" should be
moved before any skipped non-option arguments rather than being left
in the argv tail where the caller will see and interpret it.
src/misc/getopt_long.c
patch
|
blob
|
history
diff --git
a/src/misc/getopt_long.c
b/src/misc/getopt_long.c
index c3cf7f9333e05bf6122ea3ab704914af5196cc29..c3593716389c984d9200f63704f97b3cfaff876d 100644
(file)
--- a/
src/misc/getopt_long.c
+++ b/
src/misc/getopt_long.c
@@
-33,7
+33,6
@@
static int __getopt_long(int argc, char *const *argv, const char *optstring, con
if (i >= argc || !argv[i]) return -1;
if (argv[i][0] != '-') continue;
if (!argv[i][1]) continue;
- if (argv[i][1] == '-' && !argv[i][2]) return -1;
break;
}
optind = i;