diff options
Diffstat (limited to 'gcc/ada/prj-nmsc.adb')
-rw-r--r-- | gcc/ada/prj-nmsc.adb | 46 |
1 files changed, 17 insertions, 29 deletions
diff --git a/gcc/ada/prj-nmsc.adb b/gcc/ada/prj-nmsc.adb index 5d3d6290799..24007995df1 100644 --- a/gcc/ada/prj-nmsc.adb +++ b/gcc/ada/prj-nmsc.adb @@ -5031,10 +5031,7 @@ package body Prj.Nmsc is if OK then for J in 1 .. Name_Len loop - if Name_Buffer (J) = '/' - or else - Name_Buffer (J) = Directory_Separator - then + if Is_Directory_Separator (Name_Buffer (J)) then OK := False; exit; end if; @@ -5336,9 +5333,7 @@ package body Prj.Nmsc is function Compute_Directory_Last (Dir : String) return Natural is begin if Dir'Length > 1 - and then (Dir (Dir'Last - 1) = Directory_Separator - or else - Dir (Dir'Last - 1) = '/') + and then Is_Directory_Separator (Dir (Dir'Last - 1)) then return Dir'Last - 1; else @@ -5858,7 +5853,7 @@ package body Prj.Nmsc is -- Check that there is no directory information for J in 1 .. Last loop - if Line (J) = '/' or else Line (J) = Directory_Separator then + if Is_Directory_Separator (Line (J)) then Error_Msg_File_1 := Source_Name; Error_Msg (Data.Flags, @@ -6485,15 +6480,12 @@ package body Prj.Nmsc is -- Check that there is no directory information for J in 1 .. Last loop - if Line (J) = '/' - or else - Line (J) = Directory_Separator - then + if Is_Directory_Separator (Line (J)) then Error_Msg_File_1 := Name; Error_Msg (Data.Flags, - "file name cannot include " & - "directory information ({)", + "file name cannot include " + & "directory information ({)", Location, Project.Project); exit; end if; @@ -6600,10 +6592,7 @@ package body Prj.Nmsc is -- Check that there is no directory information for J in 1 .. Name_Len loop - if Name_Buffer (J) = '/' - or else - Name_Buffer (J) = Directory_Separator - then + if Is_Directory_Separator (Name_Buffer (J)) then Error_Msg_File_1 := Name; Error_Msg (Data.Flags, @@ -7394,11 +7383,11 @@ package body Prj.Nmsc is if Name (1 .. Last) /= "." and then Name (1 .. Last) /= ".." then declare Path_Name : constant String := - Normalize_Pathname - (Name => Name (1 .. Last), - Directory => Path_Str, - Resolve_Links => Resolve_Links) - & Directory_Separator; + Normalize_Pathname + (Name => Name (1 .. Last), + Directory => Path_Str, + Resolve_Links => Resolve_Links) + & Directory_Separator; Path2 : Path_Information; OK : Boolean := True; @@ -7475,8 +7464,7 @@ package body Prj.Nmsc is if Search_For = Search_Files then while Pattern_End >= Pattern'First - and then Pattern (Pattern_End) /= '/' - and then Pattern (Pattern_End) /= Directory_Separator + and then not Is_Directory_Separator (Pattern (Pattern_End)) loop Pattern_End := Pattern_End - 1; end loop; @@ -7512,9 +7500,9 @@ package body Prj.Nmsc is Recursive := Pattern_End - 1 >= Pattern'First and then Pattern (Pattern_End - 1 .. Pattern_End) = "**" - and then (Pattern_End - 1 = Pattern'First - or else Pattern (Pattern_End - 2) = '/' - or else Pattern (Pattern_End - 2) = Directory_Separator); + and then + (Pattern_End - 1 = Pattern'First + or else Is_Directory_Separator (Pattern (Pattern_End - 2))); if Recursive then Pattern_End := Pattern_End - 2; @@ -7631,7 +7619,7 @@ package body Prj.Nmsc is declare Source_Directory : constant String := Get_Name_String (Element.Value) - & Directory_Separator; + & Directory_Separator; Dir_Last : constant Natural := Compute_Directory_Last (Source_Directory); |