diff mbox series

[Ada] Remove use of a global name buffer when locating a file

Message ID 20220705083003.GA3194238@adacore.com
State New
Headers show
Series [Ada] Remove use of a global name buffer when locating a file | expand

Commit Message

Pierre-Marie de Rodat July 5, 2022, 8:30 a.m. UTC
Code cleanup; semantics is unaffected.

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

gcc/ada/

	* osint.adb (Locate_File): Use Name_Find with a parameter and
	not with a global buffer.
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
@@ -1904,10 +1904,8 @@  package body Osint is
             if Dir_Name'Length = 0 then
                Found := N;
             else
-               Name_Len := Full_Name'Length - 1;
-               Name_Buffer (1 .. Name_Len) :=
-                 Full_Name (1 .. Full_Name'Last - 1);
-               Found := Name_Find;
+               Found :=
+                 Name_Find (Full_Name (Full_Name'First .. Full_Name'Last - 1));
             end if;
          end if;
       end;