]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* as.c (std_longopts[]): Add an entry for "al" to prevent -al from being
authorNick Clifton <nickc@redhat.com>
Tue, 14 Mar 2006 15:41:57 +0000 (15:41 +0000)
committerNick Clifton <nickc@redhat.com>
Tue, 14 Mar 2006 15:41:57 +0000 (15:41 +0000)
confused with --alternate. (parse_args): Update code to find the start of the
parameters to the -a switch.

gas/ChangeLog
gas/as.c

index b00e0d25acc5d139ab3c1bb743cd1d495991bcf5..96b9702b57b9eaa7786ff418e8ca4c69bec973d9 100644 (file)
@@ -1,3 +1,10 @@
+2006-03-14  Nick Clifton  <nickc@redhat.com>
+
+       * as.c (std_longopts[]): Add an entry for "al" to prevent -al from
+       being confused with --alternate.
+       (parse_args): Update code to find the start of the parameters to
+       the -a switch.
+       
 2005-06-12  Daniel Jacobowitz  <dan@codesourcery.com>
 
        Backport from mainline:
index 919025e3788378ac2f50ef932d57280c4ed93e1b..0b5222ae0c4f8ddfb4e11a761cc306807c338bc3 100644 (file)
--- a/gas/as.c
+++ b/gas/as.c
@@ -437,11 +437,12 @@ 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.  */
+    /* The next two entries are here to prevent getopt_long_only() from
+       considering that -a or -al 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'}
+    ,{"al", optional_argument, NULL, 'a'}
     ,{"defsym", required_argument, NULL, OPTION_DEFSYM}
     ,{"dump-config", no_argument, NULL, OPTION_DUMPCONFIG}
     ,{"emulation", required_argument, NULL, OPTION_EMULATION}
@@ -791,8 +792,15 @@ 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 optarg is part of the -a switch and not a separate argument
+                in its own right, then scan backwards to the just after the -a.
+                This means skipping over both '=' and 'l' which might have been
+                taken to be part of the -a switch itself.  */
+             if (optarg != old_argv[optind])
+               {
+                 while (optarg[-1] == '=' || optarg[-1] == 'l')
+                   --optarg;
+               }
 
              if (md_parse_option (optc, optarg) != 0)
                break;
@@ -1205,7 +1213,7 @@ main (int argc, char ** argv)
     keep_it = 0;
 
   if (!keep_it)
-    unlink_if_ordinary (out_file_name);
+    unlink (out_file_name);
 
   input_scrub_end ();