diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2015-05-22 12:40:27 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2015-05-22 12:40:27 +0200 |
commit | 10af62127a5c502da9f5ccc63de4953e3301dfe7 (patch) | |
tree | 6a6e0f8ea7dd15293737c4e90e4e9bcadcef0094 /gcc | |
parent | 65467a8a46794a8010c95428b01a6887acdec258 (diff) | |
download | gcc-10af62127a5c502da9f5ccc63de4953e3301dfe7.zip gcc-10af62127a5c502da9f5ccc63de4953e3301dfe7.tar.gz gcc-10af62127a5c502da9f5ccc63de4953e3301dfe7.tar.bz2 |
Minor reformatting.
From-SVN: r223544
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/prj-util.adb | 12 | ||||
-rw-r--r-- | gcc/ada/prj-util.ads | 2 |
2 files changed, 9 insertions, 5 deletions
diff --git a/gcc/ada/prj-util.adb b/gcc/ada/prj-util.adb index ef500c3..77e26d6 100644 --- a/gcc/ada/prj-util.adb +++ b/gcc/ada/prj-util.adb @@ -804,9 +804,9 @@ package body Prj.Util is -- Relative_Path -- ------------------- - function Relative_Path (Pathname, To : String) return String is - + function Relative_Path (Pathname : String; To : String) return String is function Ensure_Directory (Path : String) return String; + -- Function spec must be commented ??? ---------------------- -- Ensure_Directory -- @@ -824,6 +824,8 @@ package body Prj.Util is end if; end Ensure_Directory; + -- Local variables + Dir_Sep_Map : constant Character_Mapping := To_Mapping ("\", "/"); P : String (1 .. Pathname'Length) := Pathname; @@ -832,6 +834,8 @@ package body Prj.Util is Pi : Natural; -- common prefix ending N : Natural := 0; + -- Start of processing for Relative_Path + begin pragma Assert (Is_Absolute_Path (Pathname)); pragma Assert (Is_Absolute_Path (To)); @@ -858,6 +862,7 @@ package body Prj.Util is -- corresponding number of "..". N := Count (T (Pi + 1 .. T'Last), "/"); + if T (T'Last) /= '/' then N := N + 1; end if; @@ -1405,8 +1410,7 @@ package body Prj.Util is Last := Last - 1; end loop; - -- If we do not find a separator, we output the maximum length - -- possible. + -- If we do not find a separator, output maximum length possible if Last < First then Last := First + Max_Length - Positive (Column); diff --git a/gcc/ada/prj-util.ads b/gcc/ada/prj-util.ads index b0ffbcc..3cdd0c7 100644 --- a/gcc/ada/prj-util.ads +++ b/gcc/ada/prj-util.ads @@ -245,7 +245,7 @@ package Prj.Util is -- are handled. This routine must be called only when the project has -- been built successfully. - function Relative_Path (Pathname, To : String) return String; + function Relative_Path (Pathname : String; To : String) return String; -- Returns the relative pathname which corresponds to Pathname when -- starting from directory to. Both Pathname and To must be absolute paths. |