projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
.
[gnulib.git]
/
lib
/
getopt.c
diff --git
a/lib/getopt.c
b/lib/getopt.c
index
8aa1353
..
e852127
100644
(file)
--- a/
lib/getopt.c
+++ b/
lib/getopt.c
@@
-27,13
+27,13
@@
#ifdef HAVE_CONFIG_H
# include <config.h>
#ifdef HAVE_CONFIG_H
# include <config.h>
-#else
-# if !defined __STDC__ || !__STDC__
+#endif
+
+#if !defined __STDC__ || !__STDC__
/* This is a separate conditional since some stdc systems
reject `defined (const)'. */
/* This is a separate conditional since some stdc systems
reject `defined (const)'. */
-# ifndef const
-# define const
-# endif
+# ifndef const
+# define const
# endif
#endif
# endif
#endif
@@
-75,11
+75,12
@@
#endif
#ifndef _
#endif
#ifndef _
-/* This is for other GNU distributions with internationalized messages.
- When compiling libc, the _ macro is predefined. */
-# ifdef HAVE_LIBINTL_H
+/* This is for other GNU distributions with internationalized messages. */
+# if defined HAVE_LIBINTL_H || defined _LIBC
# include <libintl.h>
# include <libintl.h>
-# define _(msgid) gettext (msgid)
+# ifndef _
+# define _(msgid) gettext (msgid)
+# endif
# else
# define _(msgid) (msgid)
# endif
# else
# define _(msgid) (msgid)
# endif
@@
-671,7
+672,10
@@
_getopt_internal (argc, argv, optstring, longopts, longind, long_only)
pfound = p;
indfound = option_index;
}
pfound = p;
indfound = option_index;
}
- else
+ else if (long_only
+ || pfound->has_arg != p->has_arg
+ || pfound->flag != p->flag
+ || pfound->val != p->val)
/* Second or later nonexact match found. */
ambig = 1;
}
/* Second or later nonexact match found. */
ambig = 1;
}