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

Code cleanup; semantics is unaffected.

gcc/ada/

	* osint.adb (Locate_File): Use Name_Find with a parameter and
	not with a global buffer.
This commit is contained in:
Piotr Trojanek 2022-03-26 00:13:28 +01:00 committed by Pierre-Marie de Rodat
parent 0aa855e5eb
commit aba3ce53e5

View File

@ -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;