OSDN Git Service

* targhooks.c (default_stack_protect_guard): Avoid sharing RTL
[pf3gnuchains/gcc-fork.git] / gcc / ada / osint.adb
index fd42107..6265ede 100644 (file)
@@ -813,6 +813,8 @@ package body Osint is
       end if;
 
       if Exec_Suffix'Length /= 0 then
+         Get_Name_String (Name);
+
          Add_Suffix := True;
          if Only_If_No_Suffix then
             for J in reverse 1 .. Name_Len loop
@@ -829,8 +831,6 @@ package body Osint is
          end if;
 
          if Add_Suffix then
-            Get_Name_String (Name);
-
             declare
                Buffer : String := Name_Buffer (1 .. Name_Len);
 
@@ -846,11 +846,11 @@ package body Osint is
                if Buffer'Length <= Exec_Suffix'Length
                  or else
                    Buffer (Buffer'Last - Exec_Suffix'Length + 1 .. Buffer'Last)
-                   /= Exec_Suffix.all
+                     /= Exec_Suffix.all
                then
                   Name_Buffer
                     (Name_Len + 1 .. Name_Len + Exec_Suffix'Length) :=
-                    Exec_Suffix.all;
+                      Exec_Suffix.all;
                   Name_Len := Name_Len + Exec_Suffix'Length;
                   Free (Exec_Suffix);
                   return Name_Find;
@@ -1079,6 +1079,21 @@ package body Osint is
       return Internal (Name, Attr.all'Address);
    end File_Time_Stamp;
 
+   function File_Time_Stamp
+     (Name : Path_Name_Type;
+      Attr : access File_Attributes) return Time_Stamp_Type
+   is
+   begin
+      if Name = No_Path then
+         return Empty_Time_Stamp;
+      end if;
+
+      Get_Name_String (Name);
+      Name_Buffer (Name_Len + 1) := ASCII.NUL;
+      return OS_Time_To_GNAT_Time
+               (File_Time_Stamp (Name_Buffer'Address, Attr));
+   end File_Time_Stamp;
+
    ----------------
    -- File_Stamp --
    ----------------