Commit 10af6212 by Arnaud Charlet

Minor reformatting.

From-SVN: r223544
parent 65467a8a
...@@ -804,9 +804,9 @@ package body Prj.Util is ...@@ -804,9 +804,9 @@ package body Prj.Util is
-- Relative_Path -- -- 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 Ensure_Directory (Path : String) return String;
-- Function spec must be commented ???
---------------------- ----------------------
-- Ensure_Directory -- -- Ensure_Directory --
...@@ -824,6 +824,8 @@ package body Prj.Util is ...@@ -824,6 +824,8 @@ package body Prj.Util is
end if; end if;
end Ensure_Directory; end Ensure_Directory;
-- Local variables
Dir_Sep_Map : constant Character_Mapping := To_Mapping ("\", "/"); Dir_Sep_Map : constant Character_Mapping := To_Mapping ("\", "/");
P : String (1 .. Pathname'Length) := Pathname; P : String (1 .. Pathname'Length) := Pathname;
...@@ -832,6 +834,8 @@ package body Prj.Util is ...@@ -832,6 +834,8 @@ package body Prj.Util is
Pi : Natural; -- common prefix ending Pi : Natural; -- common prefix ending
N : Natural := 0; N : Natural := 0;
-- Start of processing for Relative_Path
begin begin
pragma Assert (Is_Absolute_Path (Pathname)); pragma Assert (Is_Absolute_Path (Pathname));
pragma Assert (Is_Absolute_Path (To)); pragma Assert (Is_Absolute_Path (To));
...@@ -858,6 +862,7 @@ package body Prj.Util is ...@@ -858,6 +862,7 @@ package body Prj.Util is
-- corresponding number of "..". -- corresponding number of "..".
N := Count (T (Pi + 1 .. T'Last), "/"); N := Count (T (Pi + 1 .. T'Last), "/");
if T (T'Last) /= '/' then if T (T'Last) /= '/' then
N := N + 1; N := N + 1;
end if; end if;
...@@ -1405,8 +1410,7 @@ package body Prj.Util is ...@@ -1405,8 +1410,7 @@ package body Prj.Util is
Last := Last - 1; Last := Last - 1;
end loop; end loop;
-- If we do not find a separator, we output the maximum length -- If we do not find a separator, output maximum length possible
-- possible.
if Last < First then if Last < First then
Last := First + Max_Length - Positive (Column); Last := First + Max_Length - Positive (Column);
......
...@@ -245,7 +245,7 @@ package Prj.Util is ...@@ -245,7 +245,7 @@ package Prj.Util is
-- are handled. This routine must be called only when the project has -- are handled. This routine must be called only when the project has
-- been built successfully. -- 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 -- Returns the relative pathname which corresponds to Pathname when
-- starting from directory to. Both Pathname and To must be absolute paths. -- starting from directory to. Both Pathname and To must be absolute paths.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment