]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Ada] Remove use of a global name buffer when locating a file
authorPiotr Trojanek <trojanek@adacore.com>
Fri, 25 Mar 2022 23:13:28 +0000 (00:13 +0100)
committerPierre-Marie de Rodat <derodat@adacore.com>
Tue, 5 Jul 2022 08:28:20 +0000 (08:28 +0000)
Code cleanup; semantics is unaffected.

gcc/ada/

* osint.adb (Locate_File): Use Name_Find with a parameter and
not with a global buffer.

gcc/ada/osint.adb

index eeedfcbc3aed92bbd97195b6a507fdc89406cc9b..86fbf2d0922eae806668ff1768e9332d729aae4b 100644 (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;