aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/osint.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2014-08-04 12:57:32 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2014-08-04 12:57:32 +0200
commit3ccedacc889a1eac92eed26a0006b9cc3eeda19b (patch)
treed6f8f350a66150fb3508f68a68d6944ea0d841ff /gcc/ada/osint.adb
parentf3124d8f6431bcfce76eca31a198ba89ce0d15fe (diff)
downloadgcc-3ccedacc889a1eac92eed26a0006b9cc3eeda19b.zip
gcc-3ccedacc889a1eac92eed26a0006b9cc3eeda19b.tar.gz
gcc-3ccedacc889a1eac92eed26a0006b9cc3eeda19b.tar.bz2
[multiple changes]
2014-08-04 Robert Dewar <dewar@adacore.com> * sem_ch6.adb: Minor reformatting. 2014-08-04 Ed Schonberg <schonberg@adacore.com> * sem_prag.adb (Analyze_Pragma, case Assert and related pragmas): Before normalizing these pragmas into a pragma Check, preanalyze the optional Message argument, (which is subsequently copied) so that it has the proper semantic information for ASIS use. * sem_case.adb: Initialize flag earlier. * osint.adb, osint.ads (Find_File): Add parameter Full_Name, used when the full source path of a configuration file is requested. (Read_Source_File): Use Full_Name parameter.. From-SVN: r213571
Diffstat (limited to 'gcc/ada/osint.adb')
-rw-r--r--gcc/ada/osint.adb41
1 files changed, 29 insertions, 12 deletions
diff --git a/gcc/ada/osint.adb b/gcc/ada/osint.adb
index 93e2550..3fd796c 100644
--- a/gcc/ada/osint.adb
+++ b/gcc/ada/osint.adb
@@ -119,10 +119,11 @@ package body Osint is
-- failure
procedure Find_File
- (N : File_Name_Type;
- T : File_Type;
- Found : out File_Name_Type;
- Attr : access File_Attributes);
+ (N : File_Name_Type;
+ T : File_Type;
+ Found : out File_Name_Type;
+ Attr : access File_Attributes;
+ Full_Name : Boolean := False);
-- A version of Find_File that also returns a cache of the file attributes
-- for later reuse
@@ -1153,13 +1154,14 @@ package body Osint is
---------------
function Find_File
- (N : File_Name_Type;
- T : File_Type) return File_Name_Type
+ (N : File_Name_Type;
+ T : File_Type;
+ Full_Name : Boolean := False) return File_Name_Type
is
Attr : aliased File_Attributes;
Found : File_Name_Type;
begin
- Find_File (N, T, Found, Attr'Access);
+ Find_File (N, T, Found, Attr'Access, Full_Name);
return Found;
end Find_File;
@@ -1168,10 +1170,11 @@ package body Osint is
---------------
procedure Find_File
- (N : File_Name_Type;
- T : File_Type;
- Found : out File_Name_Type;
- Attr : access File_Attributes) is
+ (N : File_Name_Type;
+ T : File_Type;
+ Found : out File_Name_Type;
+ Attr : access File_Attributes;
+ Full_Name : Boolean := False) is
begin
Get_Name_String (N);
@@ -1193,6 +1196,20 @@ package body Osint is
then
Found := N;
Attr.all := Unknown_Attributes;
+
+ if T = Config and then Full_Name then
+ declare
+ Full_Path : constant String :=
+ Normalize_Pathname (Get_Name_String (N));
+ Full_Size : constant Natural := Full_Path'Length;
+
+ begin
+ Name_Buffer (1 .. Full_Size) := Full_Path;
+ Name_Len := Full_Size;
+ Found := Name_Find;
+ end;
+ end if;
+
return;
-- If we are trying to find the current main file just look in the
@@ -2591,7 +2608,7 @@ package body Osint is
-- For the call to Close
begin
- Current_Full_Source_Name := Find_File (N, T);
+ Current_Full_Source_Name := Find_File (N, T, Full_Name => True);
Current_Full_Source_Stamp := File_Stamp (Current_Full_Source_Name);
if Current_Full_Source_Name = No_File then