summaryrefslogtreecommitdiff
path: root/lib/getopt.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2000-09-06 20:04:06 +0000
committerJim Meyering <jim@meyering.net>2000-09-06 20:04:06 +0000
commit7ed190837a0f94957b8ba58fcce7e921b5af6865 (patch)
tree898e9d405e462c307b4fd4d7886414dae46f9631 /lib/getopt.c
parent812dc8da172e80819adaed7b6f797a13ee6a98d0 (diff)
downloadcoreutils-7ed190837a0f94957b8ba58fcce7e921b5af6865.tar.xz
(_getopt_internal): Update from glibc.
Diffstat (limited to 'lib/getopt.c')
-rw-r--r--lib/getopt.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/getopt.c b/lib/getopt.c
index 8aa135368..c7ddad0fe 100644
--- a/lib/getopt.c
+++ b/lib/getopt.c
@@ -27,13 +27,13 @@
#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)'. */
-# 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;
}