aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2005-01-20 15:35:57 +0000
committerNick Clifton <nickc@redhat.com>2005-01-20 15:35:57 +0000
commitfb7679136e9da436e99ae328fe0351b7e87e190e (patch)
tree340254753c6fb8c80c97e9aee23b837cadd7976c
parent9c1831834775d613a2024bf473b87bca1e5af459 (diff)
downloadgdb-fb7679136e9da436e99ae328fe0351b7e87e190e.zip
gdb-fb7679136e9da436e99ae328fe0351b7e87e190e.tar.gz
gdb-fb7679136e9da436e99ae328fe0351b7e87e190e.tar.bz2
(std_longopts): Add an entry for "--a" in order to prevent getopt_long_only()
from considering -a as an abbreviation for --alternate. (parse_args): Fix the parsing of -a=<file>.
-rw-r--r--gas/ChangeLog7
-rw-r--r--gas/as.c8
2 files changed, 15 insertions, 0 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 572d8e0..ca40e8a 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,10 @@
+2005-01-20 Nick Clifton <nickc@redhat.com>
+
+ * as.c (std_longopts): Add an entry for "--a" in order to prevent
+ getopt_long_only() from considering -a as an abbreviation for
+ --alternate.
+ (parse_args): Fix the parsing of -a=<file>.
+
2005-01-20 Alan Modra <amodra@bigpond.net.au>
PR gas/684
diff --git a/gas/as.c b/gas/as.c
index 6064755..915a5eb 100644
--- a/gas/as.c
+++ b/gas/as.c
@@ -437,6 +437,11 @@ parse_args (int * pargc, char *** pargv)
the end of the preceeding line so that it is simpler to
selectively add and remove lines from this list. */
{"alternate", no_argument, NULL, OPTION_ALTERNATE}
+ /* The entry for "a" is here to prevent getopt_long_only() from
+ considering that -a is an abbreviation for --alternate. This is
+ necessary because -a=<FILE> is a valid switch but getopt would
+ normally reject it since --alternate does not take an argument. */
+ ,{"a", optional_argument, NULL, 'a'}
,{"defsym", required_argument, NULL, OPTION_DEFSYM}
,{"dump-config", no_argument, NULL, OPTION_DUMPCONFIG}
,{"emulation", required_argument, NULL, OPTION_EMULATION}
@@ -786,6 +791,9 @@ the GNU General Public License. This program has absolutely no warranty.\n"));
case 'a':
if (optarg)
{
+ if (optarg != old_argv[optind] && optarg[-1] == '=')
+ --optarg;
+
if (md_parse_option (optc, optarg) != 0)
break;