From: Jim Meyering Date: Wed, 6 Sep 2000 20:04:06 +0000 (+0000) Subject: (_getopt_internal): Update from glibc. X-Git-Tag: FILEUTILS-4_0z~29 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=7ed190837a0f94957b8ba58fcce7e921b5af6865;p=thirdparty%2Fcoreutils.git (_getopt_internal): Update from glibc. --- diff --git a/lib/getopt.c b/lib/getopt.c index 8aa1353684..c7ddad0fe8 100644 --- a/lib/getopt.c +++ b/lib/getopt.c @@ -27,13 +27,13 @@ #ifdef HAVE_CONFIG_H # include -#else -# if !defined __STDC__ || !__STDC__ +#endif + +#if !defined __STDC__ || !__STDC__ /* This is a separate conditional since some stdc systems reject `defined (const)'. */ -# ifndef const -# define const -# endif +# ifndef const +# define const # endif #endif @@ -671,7 +671,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; }