(_getopt_internal): Update from glibc.
[gnulib.git] / lib / getopt.c
index c7ddad0..a5bc2c9 100644 (file)
@@ -671,7 +671,8 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
                pfound = p;
                indfound = option_index;
              }
-           else if (pfound->has_arg != p->has_arg
+           else if (long_only
+                    || pfound->has_arg != p->has_arg
                     || pfound->flag != p->flag
                     || pfound->val != p->val)
              /* Second or later nonexact match found.  */