gcc.c (give_switch): Don't write before start of string.
authorJakub Jelinek <jakub@redhat.com>
Wed, 16 May 2001 12:23:30 +0000 (14:23 +0200)
committerNathan Sidwell <nathan@gcc.gnu.org>
Wed, 16 May 2001 12:23:30 +0000 (12:23 +0000)
        * gcc.c (give_switch): Don't write before start of string.
Always append suffix.

Co-Authored-By: Nathan Sidwell <nathan@codesourcery.com>
From-SVN: r42152

gcc/ChangeLog
gcc/gcc.c

index 313038aebb8e8a2be9105cb37fa85272599b3605..21ffd19a83c132271fb9cf8cee2afd68bc3eca03 100644 (file)
@@ -1,3 +1,9 @@
+2001-05-16  Jakub Jelinek  <jakub@redhat.com>
+           Nathan Sidwell  <nathan@codesourcery.com>
+           
+        * gcc.c (give_switch): Don't write before start of string.
+       Always append suffix.
+
 2001-05-16  Nathan Sidwell  <nathan@codesourcery.com>
 
        * cpplex.c (_cpp_lex_token, '/' case): Comments can't appear
index d92f56a4593cceddf5dc9d35c3b6dea29d20c110..7d99417ed97bdba83cc301980c3ab38ef13d762c 100644 (file)
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -5289,19 +5289,19 @@ give_switch (switchnum, omit_first_word, include_blanks)
          if (suffix_subst)
            {
              unsigned length = strlen (arg);
+             int dot = 0;
 
              while (length-- && !IS_DIR_SEPARATOR (arg[length]))
                if (arg[length] == '.')
                  {
                    ((char *)arg)[length] = 0;
+                   dot = 1;
                    break;
                  }
              do_spec_1 (arg, 1, NULL);
-             if (!arg[length])
-               {
-                 ((char *)arg)[length] = '.';
-                 do_spec_1 (suffix_subst, 1, NULL);
-               }
+             if (dot)
+               ((char *)arg)[length] = '.';
+             do_spec_1 (suffix_subst, 1, NULL);
            }
          else
            do_spec_1 (arg, 1, NULL);