+2015-10-26 Emmanuel Briot <briot@adacore.com>
+
+ * s-os_lib.adb (Argument_String_To_List): Remove backslashes in
+ argument value.
+
+2015-10-26 Javier Miranda <miranda@adacore.com>
+
+ * exp_unst.ads, exp_unst.adb (Is_Uplevel_Referenced): Removed.
+
2015-10-26 Hristian Kirtchev <kirtchev@adacore.com>
* exp_util.adb, sem_aux.adb, exp_attr.adb, sem_eval.adb: Minor
Table_Increment => 200,
Table_Name => "Unnest_Urefs");
- ---------------------------
- -- Is_Uplevel_Referenced --
- ---------------------------
-
- function Is_Uplevel_Referenced (E : Entity_Id) return Boolean is
- begin
- for J in Urefs.First .. Urefs.Last loop
- if Urefs.Table (J).Ent = E then
- return True;
- end if;
- end loop;
-
- return False;
- end Is_Uplevel_Referenced;
-
-----------------------
-- Unnest_Subprogram --
-----------------------
-- adds the ARECP parameter to all nested subprograms which need it, and
-- modifies all uplevel references appropriately.
- function Is_Uplevel_Referenced (E : Entity_Id) return Boolean;
- -- Determines if E has some uplevel reference from a nested subprogram
-
end Exp_Unst;
New_Argc : Natural := 0;
Idx : Integer;
+ Cleaned : String (1 .. Arg_String'Length);
+ Cleaned_Idx : Natural;
+ -- A cleaned up version of the argument. This function is taking
+ -- backslash escapes when computing the bounds for arguments. It is
+ -- then removing the extra backslashes from the argument.
+
begin
Idx := Arg_String'First;
declare
Quoted : Boolean := False;
Backqd : Boolean := False;
- Old_Idx : Integer;
begin
- Old_Idx := Idx;
+ Cleaned_Idx := Cleaned'First;
loop
-- An unquoted space is the end of an argument
and then Arg_String (Idx) = '"'
then
Quoted := True;
+ Cleaned (Cleaned_Idx) := Arg_String (Idx);
+ Cleaned_Idx := Cleaned_Idx + 1;
-- End of a quoted string and end of an argument
elsif (Quoted and not Backqd)
and then Arg_String (Idx) = '"'
then
+ Cleaned (Cleaned_Idx) := Arg_String (Idx);
+ Cleaned_Idx := Cleaned_Idx + 1;
Idx := Idx + 1;
exit;
- -- Following character is backquoted
-
- elsif Arg_String (Idx) = '\' then
- Backqd := True;
-
-- Turn off backquoting after advancing one character
elsif Backqd then
Backqd := False;
+ Cleaned (Cleaned_Idx) := Arg_String (Idx);
+ Cleaned_Idx := Cleaned_Idx + 1;
+ -- Following character is backquoted
+
+ elsif Arg_String (Idx) = '\' then
+ Backqd := True;
+
+ else
+ Cleaned (Cleaned_Idx) := Arg_String (Idx);
+ Cleaned_Idx := Cleaned_Idx + 1;
end if;
Idx := Idx + 1;
New_Argc := New_Argc + 1;
New_Argv (New_Argc) :=
- new String'(Arg_String (Old_Idx .. Idx - 1));
+ new String'(Cleaned (Cleaned'First .. Cleaned_Idx - 1));
-- Skip extraneous spaces