[gcc r13-1491] [Ada] Remove use of a global name buffer when locating a file

Pierre-Marie de Rodat pmderodat@gcc.gnu.org
Tue Jul 5 08:30:49 GMT 2022


https://gcc.gnu.org/g:aba3ce53e5dc855172164f51080cd71f05f1d994

commit r13-1491-gaba3ce53e5dc855172164f51080cd71f05f1d994
Author: Piotr Trojanek <trojanek@adacore.com>
Date:   Sat Mar 26 00:13:28 2022 +0100

    [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.

Diff:
---
 gcc/ada/osint.adb | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/gcc/ada/osint.adb b/gcc/ada/osint.adb
index eeedfcbc3ae..86fbf2d0922 100644
--- 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;


More information about the Gcc-cvs mailing list