g-comlin.adb (Getopt): Fix handling of "*" switch when not collapsing switches.
authorEmmanuel Briot <briot@adacore.com>
Tue, 14 Aug 2007 08:47:56 +0000 (10:47 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Tue, 14 Aug 2007 08:47:56 +0000 (10:47 +0200)
2007-08-14  Emmanuel Briot  <briot@adacore.com>

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

From-SVN: r127451

gcc/ada/g-comlin.adb

index 52a15550762c14713c1f57118fa71bc78564c666..9abd4b0f9dcaa313072556db88be6a366d3803d4 100644 (file)
@@ -581,6 +581,17 @@ package body GNAT.Command_Line is
                      --  If Concatenate is False and the full argument is not
                      --  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,
                                     Arg_Num => Current_Argument,
                                     First   => Current_Index,
@@ -597,6 +608,17 @@ package body GNAT.Command_Line is
             --  If Concatenate is False and the full argument is not
             --  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,
                            Arg_Num => Current_Argument,
                            First   => Current_Index,