g-comlin.adb (Getopt): Fix handling of "*" switch when not collapsing switches.

2007-08-14  Emmanuel Briot  <briot@adacore.com>

	* g-comlin.adb (Getopt): Fix handling of "*" switch when not collapsing
	switches.

From-SVN: r127451
This commit is contained in:
Emmanuel Briot 2007-08-14 10:47:56 +02:00 committed by Arnaud Charlet
parent 154c16575f
commit 171d182e7f

View File

@ -581,6 +581,17 @@ package body GNAT.Command_Line is
-- If Concatenate is False and the full argument is not -- If Concatenate is False and the full argument is not
-- recognized as a switch, this is an invalid switch. -- recognized as a switch, this is an invalid switch.
if Switches (Switches'First) = '*' then
Set_Parameter
(The_Switch,
Arg_Num => Current_Argument,
First => 1,
Last => CL.Argument (Current_Argument)'Last);
Is_Switch (Current_Argument) := True;
Dummy := Goto_Next_Argument_In_Section;
return '*';
end if;
Set_Parameter (The_Switch, Set_Parameter (The_Switch,
Arg_Num => Current_Argument, Arg_Num => Current_Argument,
First => Current_Index, First => Current_Index,
@ -597,6 +608,17 @@ package body GNAT.Command_Line is
-- If Concatenate is False and the full argument is not -- If Concatenate is False and the full argument is not
-- recognized as a switch, this is an invalid switch. -- recognized as a switch, this is an invalid switch.
if Switches (Switches'First) = '*' then
Set_Parameter
(The_Switch,
Arg_Num => Current_Argument,
First => 1,
Last => CL.Argument (Current_Argument)'Last);
Is_Switch (Current_Argument) := True;
Dummy := Goto_Next_Argument_In_Section;
return '*';
end if;
Set_Parameter (The_Switch, Set_Parameter (The_Switch,
Arg_Num => Current_Argument, Arg_Num => Current_Argument,
First => Current_Index, First => Current_Index,