From e65677af0f6477991bbd8950d4bb084c0948754f Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Wed, 16 May 2001 14:23:30 +0200 Subject: [PATCH] gcc.c (give_switch): Don't write before start of string. * gcc.c (give_switch): Don't write before start of string. Always append suffix. Co-Authored-By: Nathan Sidwell From-SVN: r42152 --- gcc/ChangeLog | 6 ++++++ gcc/gcc.c | 10 +++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 313038aebb8..21ffd19a83c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2001-05-16 Jakub Jelinek + Nathan Sidwell + + * gcc.c (give_switch): Don't write before start of string. + Always append suffix. + 2001-05-16 Nathan Sidwell * cpplex.c (_cpp_lex_token, '/' case): Comments can't appear diff --git a/gcc/gcc.c b/gcc/gcc.c index d92f56a4593..7d99417ed97 100644 --- 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); -- 2.30.2