about summary refs log tree commit diff
path: root/src/misc
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2016-10-20 12:13:33 -0400
committerRich Felker <dalias@aerifal.cx>2016-10-20 12:13:33 -0400
commitb24f1d2520c87077cef21e085893e5f3c565a6df (patch)
tree0750d2803a3fc68b6f801794ef13a2d47cdb683d /src/misc
parent51ab6db4ed115d079d7131975e4adb074ba9ef9d (diff)
downloadmusl-b24f1d2520c87077cef21e085893e5f3c565a6df.tar.gz
musl-b24f1d2520c87077cef21e085893e5f3c565a6df.tar.xz
musl-b24f1d2520c87077cef21e085893e5f3c565a6df.zip
fix getopt_long_only misinterpreting "--" as an option
Diffstat (limited to 'src/misc')
-rw-r--r--src/misc/getopt_long.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/misc/getopt_long.c b/src/misc/getopt_long.c
index 480c0013..c6e14625 100644
--- 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]=='-']==':';