+2012-02-08 Pascal Obry <obry@adacore.com>
+
+ * prj.adb (Compute_All_Imported_Projects): Use new
+ For_Project_And_Aggregated_Context to ensure proper context is
+ used for encapsulated aggregate libraries.
+ * prj-proc.adb (Recursive_Process): Call
+ Process_Aggregated_Projects earlier to ensure that all dependent
+ projects are set with the proper encapsulated status.
+
+2012-02-08 Pascal Obry <obry@adacore.com>
+
+ * s-os_lib.adb (Normalize_Arguments): Properly escape last \ in null
+ terminated string.
+
2012-02-08 Pascal Obry <obry@adacore.com>
* prj.ads, prj.adb (For_Project_And_Aggregated_Context): New
Process_Imported_Projects (Imported, Limited_With => True);
+ if Err_Vars.Total_Errors_Detected = 0 then
+ Process_Aggregated_Projects;
+ end if;
+
-- At this point (after Process_Declarative_Items) we have the
-- attribute values set, we can backtrace In_Tree.Project and
-- set the From_Encapsulated_Library status.
end if;
if Err_Vars.Total_Errors_Detected = 0 then
- Process_Aggregated_Projects;
-- For an aggregate library we add the aggregated projects
-- as imported ones. This is necessary to give visibility
is
procedure Analyze_Tree
(Local_Root : Project_Id;
- Local_Tree : Project_Tree_Ref);
+ Local_Tree : Project_Tree_Ref;
+ Context : Project_Context);
-- Process Project and all its aggregated project to analyze their own
-- imported projects.
procedure Analyze_Tree
(Local_Root : Project_Id;
- Local_Tree : Project_Tree_Ref)
+ Local_Tree : Project_Tree_Ref;
+ Context : Project_Context)
is
pragma Unreferenced (Local_Root);
Project.All_Imported_Projects :=
new Project_List_Element'
(Project => Prj2,
- From_Encapsulated_Lib => Context.From_Encapsulated_Lib,
+ From_Encapsulated_Lib =>
+ Context.From_Encapsulated_Lib
+ or else Analyze_Tree.Context.From_Encapsulated_Lib,
Next => Project.All_Imported_Projects);
end if;
end Recursive_Add;
end Analyze_Tree;
procedure For_Aggregates is
- new For_Project_And_Aggregated (Analyze_Tree);
+ new For_Project_And_Aggregated_Context (Analyze_Tree);
-- Start of processing for Compute_All_Imported_Projects
-- --
-- B o d y --
-- --
--- Copyright (C) 1995-2010, AdaCore --
+-- Copyright (C) 1995-2012, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
pragma Compiler_Unit;
-with System.Case_Util;
-with System.CRTL;
-with System.Soft_Links;
with Ada.Unchecked_Conversion;
with Ada.Unchecked_Deallocation;
with System; use System;
+with System.Case_Util;
+with System.CRTL;
+with System.Soft_Links;
package body System.OS_Lib is
-- If null terminated string, put the quote before
if Res (J) = ASCII.NUL then
+
+ -- If the string ends with \, double it
+
+ if Res (J - 1) = '\' then
+ Res (J) := '\';
+ J := J + 1;
+ end if;
+
+ -- Then adds the quote and the NUL character
+
Res (J) := '"';
J := J + 1;
Res (J) := ASCII.NUL;
Start := Last;
loop
Start := Start - 1;
- exit when Start < 1 or else
- Path_Buffer (Start) = Directory_Separator;
+ exit when Start < 1
+ or else Path_Buffer (Start) = Directory_Separator;
end loop;
if Start <= 1 then