diff mbox series

[Ada] PR ada/79724

Message ID 20220111133222.GA748798@adacore.com
State New
Headers show
Series [Ada] PR ada/79724 | expand

Commit Message

Pierre-Marie de Rodat Jan. 11, 2022, 1:32 p.m. UTC
Fix handling of e.g. gcc-11 in Osint.Program_Name.

Tested on x86_64-pc-linux-gnu, committed on trunk

gcc/ada/

	PR ada/79724
	* osint.adb (Program_Name): Fix handling of suffixes.
diff mbox series

Patch

diff --git a/gcc/ada/osint.adb b/gcc/ada/osint.adb
--- a/gcc/ada/osint.adb
+++ b/gcc/ada/osint.adb
@@ -2279,8 +2279,6 @@  package body Osint is
 
       Find_Program_Name;
 
-      Start_Of_Suffix := Name_Len + 1;
-
       --  Find the target prefix if any, for the cross compilation case.
       --  For instance in "powerpc-elf-gcc" the target prefix is
       --  "powerpc-elf-"
@@ -2304,9 +2302,7 @@  package body Osint is
          end if;
       end loop;
 
-      if End_Of_Prefix > 1 then
-         Start_Of_Suffix := End_Of_Prefix + Prog'Length + 1;
-      end if;
+      Start_Of_Suffix := End_Of_Prefix + Prog'Length + 1;
 
       --  Create the new program name