N_RUNS : constant String := "runs";
N_SCHEMA : constant String := "$schema";
N_START_COLUMN : constant String := "startColumn";
- N_START_LINE : constant String := "strartLine";
+ N_START_LINE : constant String := "startLine";
N_TEXT : constant String := "text";
N_TOOL : constant String := "tool";
N_URI : constant String := "uri";
function Compose_Command_Line return String is
Buffer : Bounded_String;
begin
+ Find_Program_Name;
+ Append (Buffer, Name_Buffer (1 .. Name_Len));
+ Append (Buffer, ' ');
Append (Buffer, Get_First_Main_File_Name);
for I in 1 .. Compilation_Switches_Last loop
declare
-- Print executionSuccessful
- Write_Boolean_Attribute (N_EXECUTION_SUCCESSFUL, Compilation_Errors);
+ Write_Boolean_Attribute (N_EXECUTION_SUCCESSFUL, not Compilation_Errors);
End_Block;
NL_And_Indent;
---------------------
function Get_Current_Dir return String is
- Current_Dir : String (1 .. Max_Path + 1);
- Last : Natural;
+ Path_Len : Natural := Max_Path;
+ Buffer : String (1 .. 1 + Max_Path + 1);
+
begin
- Get_Current_Dir (Current_Dir'Address, Last'Address);
- return Current_Dir (1 .. Last);
+ Get_Current_Dir (Buffer'Address, Path_Len'Address);
+
+ if Path_Len = 0 then
+ raise Program_Error;
+ end if;
+
+ return Buffer (1 .. Path_Len);
end Get_Current_Dir;
-------------------
Append (Rel_Path, ".." & System.OS_Lib.Directory_Separator);
end loop;
+ -- Avoid starting the relative path with a directory separator
+
+ if Last < Norm_Path'Length
+ and then Is_Directory_Separator (Norm_Path (Norm_Path'First + Last))
+ then
+ Last := Last + 1;
+ end if;
+
-- Add the rest of the path from the common point
Append
function Relative_Path (Path : String; Ref : String) return String;
-- Given an absolute path Path calculate its relative path from a reference
-- directory Ref.
+ --
+ -- If the paths are the same it will return ".".
+ --
+ -- If the paths are on different drives on Windows based systems then it
+ -- will return the normalized version of Path.
function Relocate_Path
(Prefix : String;