diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-08-20 15:50:40 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-08-20 15:50:40 +0000 |
commit | 1dd5f113143bd0fda3bf20c62ffc25df8cac2008 (patch) | |
tree | 4caed945ac80ce312cf5e7eb62e52956288ad2c7 /gcc/ada/g-comlin.adb | |
parent | 775bb8fd83c27c6cf34a0bbba3e03c054b999d48 (diff) | |
download | gcc-1dd5f113143bd0fda3bf20c62ffc25df8cac2008.tar.gz |
2008-08-20 Robert Dewar <dewar@adacore.com>
* g-comlin.adb: Minor reformatting
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@139319 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/g-comlin.adb')
-rw-r--r-- | gcc/ada/g-comlin.adb | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/gcc/ada/g-comlin.adb b/gcc/ada/g-comlin.adb index e3070414dc3..b5a82d5dc9c 100644 --- a/gcc/ada/g-comlin.adb +++ b/gcc/ada/g-comlin.adb @@ -1566,8 +1566,8 @@ package body GNAT.Command_Line is end loop; end if; - -- Determine if the added switch is a known switch with parameter - -- attached. + -- Test if added switch is a known switch with parameter attached + if Parameter = "" and then Cmd.Config /= null and then Cmd.Config.Switches /= null @@ -1580,8 +1580,10 @@ package body GNAT.Command_Line is Param : Natural; begin + -- Verify that switch starts with Sw + -- What if the "verification" fails??? + if Switch'Length >= Sw'Length - -- Verify that switch starts with Sw and then Looking_At (Switch, Switch'First, Sw) then Param := Switch'First + Sw'Length - 1; @@ -1595,13 +1597,13 @@ package body GNAT.Command_Line is end loop; end if; - -- If the full Switch is a known switch with attached - -- parameter, then we use this parameter in the callback. + -- If full Switch is a known switch with attached parameter + -- then we use this parameter in the callback. + if Last = Switch'Last then Callback (Switch (Switch'First .. Param), Switch (Param + 1 .. Last)); - return; end if; @@ -1647,7 +1649,7 @@ package body GNAT.Command_Line is is procedure Add_Simple_Switch (Simple : String; Param : String); -- Add a new switch that has had all its aliases expanded, and switches - -- ungrouped. We know there is no more aliases in Switches + -- ungrouped. We know there are no more aliases in Switches. ----------------------- -- Add_Simple_Switch -- @@ -1675,7 +1677,7 @@ package body GNAT.Command_Line is end if; else - -- Do we already have this switch ? + -- Do we already have this switch? for C in Cmd.Expanded'Range loop if Cmd.Expanded (C).all = Simple @@ -1760,9 +1762,9 @@ package body GNAT.Command_Line is Unchecked_Free (Tmp); end Remove; - ------------ - -- Append -- - ------------ + --------- + -- Add -- + --------- procedure Add (Line : in out Argument_List_Access; @@ -1770,6 +1772,7 @@ package body GNAT.Command_Line is Before : Boolean := False) is Tmp : Argument_List_Access := Line; + begin if Tmp /= null then Line := new Argument_List (Tmp'First .. Tmp'Last + 1); @@ -1783,6 +1786,7 @@ package body GNAT.Command_Line is end if; Unchecked_Free (Tmp); + else Line := new Argument_List'(1 .. 1 => Str); end if; @@ -1916,7 +1920,7 @@ package body GNAT.Command_Line is Remove (Cmd.Sections, C); -- The switch is necessarily unique by construction of - -- Add_Switch + -- Add_Switch. return; @@ -1948,7 +1952,7 @@ package body GNAT.Command_Line is Params : Argument_List_Access) is function Compatible_Parameter (Param : String_Access) return Boolean; - -- Tell if the parameter can be part of a group + -- True when the parameter can be part of a group -------------------------- -- Compatible_Parameter -- |