aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--posix/getopt.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/posix/getopt.c b/posix/getopt.c
index f1add57..2ad4ee9 100644
--- a/posix/getopt.c
+++ b/posix/getopt.c
@@ -673,7 +673,9 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
pfound = p;
indfound = option_index;
}
- else
+ else if (pfound->has_arg != p->has_arg
+ || pfound->flag != p->flag
+ || pfound->val != p->val)
/* Second or later nonexact match found. */
ambig = 1;
}