aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJerome Lambourg <lambourg@adacore.com>2008-08-06 10:52:44 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2008-08-06 10:52:44 +0200
commit32b9901464b67e926bbc791a4c74fff1d2bab7ec (patch)
tree6189b253ac1f4acc2ceb148109bbf601ed7c0dbb /gcc
parentc9b9957118ebcb122ffeef1b73184e5b8736b2ef (diff)
downloadgcc-32b9901464b67e926bbc791a4c74fff1d2bab7ec.zip
gcc-32b9901464b67e926bbc791a4c74fff1d2bab7ec.tar.gz
gcc-32b9901464b67e926bbc791a4c74fff1d2bab7ec.tar.bz2
g-comlin.adb (Set_Command_Line): Now that aliases can contain parameters, always specify the expected separator.
2008-08-06 Jerome Lambourg <lambourg@adacore.com> * g-comlin.adb (Set_Command_Line): Now that aliases can contain parameters, always specify the expected separator. From-SVN: r138780
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/g-comlin.adb20
1 files changed, 17 insertions, 3 deletions
diff --git a/gcc/ada/g-comlin.adb b/gcc/ada/g-comlin.adb
index 221b3a3..02a0f9a 100644
--- a/gcc/ada/g-comlin.adb
+++ b/gcc/ada/g-comlin.adb
@@ -1295,13 +1295,19 @@ package body GNAT.Command_Line is
-- Add it with no parameter, if that's the way the user
-- wants it.
+ -- Specify the separator in all cases, as the switch might
+ -- need to be unaliased, and the alias might contain
+ -- switches with parameters.
if Section = null then
Add_Switch
- (Cmd, Switch_Char & Full_Switch (Parser));
+ (Cmd, Switch_Char & Full_Switch (Parser),
+ Separator => Separator (Parser));
else
Add_Switch
- (Cmd, Switch_Char & Full_Switch (Parser), Section.all);
+ (Cmd, Switch_Char & Full_Switch (Parser),
+ Separator => Separator (Parser),
+ Section => Section.all);
end if;
end;
end loop;
@@ -1439,9 +1445,17 @@ package body GNAT.Command_Line is
if not Require_Parameter (Cmd.Config.Switches (S).all)
or else Last >= Param
then
- if Idx = Group'First and then Last = Group'Last then
+ if Idx = Group'First
+ and then Last = Group'Last
+ and then Last < Param
+ then
-- The group only concerns a single switch. Do not
-- perform recursive call.
+
+ -- Note that we still perform a recursive call if
+ -- a parameter is detected in the switch, as this
+ -- is a way to correctly identify such a parameter
+ -- in aliases.
return False;
end if;