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:
51ab6db
)
fix getopt_long_only misinterpreting "--" as an option
author
Rich Felker
<dalias@aerifal.cx>
Thu, 20 Oct 2016 16:13:33 +0000
(12:13 -0400)
committer
Rich Felker
<dalias@aerifal.cx>
Thu, 20 Oct 2016 16:13:33 +0000
(12:13 -0400)
src/misc/getopt_long.c
patch
|
blob
|
history
diff --git
a/src/misc/getopt_long.c
b/src/misc/getopt_long.c
index 480c00139e08682fd15d5798d871be4c85111b76..c6e146251801835add4a2c4f36711eb4e162dbcf 100644
(file)
--- a/
src/misc/getopt_long.c
+++ b/
src/misc/getopt_long.c
@@
-53,7
+53,7
@@
static int __getopt_long_core(int argc, char *const *argv, const char *optstring
{
optarg = 0;
if (longopts && argv[optind][0] == '-' &&
- ((longonly && argv[optind][1]) ||
+ ((longonly && argv[optind][1]
&& argv[optind][1] != '-'
) ||
(argv[optind][1] == '-' && argv[optind][2])))
{
int colon = optstring[optstring[0]=='+'||optstring[0]=='-']==':';