aboutsummaryrefslogtreecommitdiff
path: root/ld/lexsup.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2000-12-31 19:56:04 +0000
committerNick Clifton <nickc@redhat.com>2000-12-31 19:56:04 +0000
commit0fc3347a5cbe0d5c58a4ac3c75d05a93773002fb (patch)
tree60bc4750fba42e739ec4cbd8e2454f1938fab8f4 /ld/lexsup.c
parent67db5ab439b50465821b98f47679ea9cc184e774 (diff)
downloadfsf-binutils-gdb-0fc3347a5cbe0d5c58a4ac3c75d05a93773002fb.zip
fsf-binutils-gdb-0fc3347a5cbe0d5c58a4ac3c75d05a93773002fb.tar.gz
fsf-binutils-gdb-0fc3347a5cbe0d5c58a4ac3c75d05a93773002fb.tar.bz2
Fix problems with new EXACTLY_TWO_DASHES command line switch option.
Diffstat (limited to 'ld/lexsup.c')
-rw-r--r--ld/lexsup.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/ld/lexsup.c b/ld/lexsup.c
index eb1fc2d..80ccc6e 100644
--- a/ld/lexsup.c
+++ b/ld/lexsup.c
@@ -543,14 +543,22 @@ parse_args (argc, argv)
/* getopt_long_only is like getopt_long, but '-' as well as '--'
can indicate a long option. */
+ opterr = 0;
optc = getopt_long_only (argc, argv, shortopts, longopts, &longind);
- if (optc == -1)
- optc = getopt_long (argc, argv, shortopts, really_longopts, &longind);
-
+ if (optc == '?')
+ {
+ --optind;
+ optc = getopt_long (argc, argv, shortopts, really_longopts, &longind);
+ }
+
if (optc == -1)
break;
+
switch (optc)
{
+ case '?':
+ fprintf (stderr, _("%s: unrecognized option '%s'\n"),
+ program_name, argv[optind - 1]);
default:
fprintf (stderr,
_("%s: use the --help option for usage information\n"),