Break out of the command word parsing loop if we hit
authorJason Molenda <jmolenda@apple.com>
Fri, 17 Oct 2014 02:10:33 +0000 (02:10 +0000)
committerJason Molenda <jmolenda@apple.com>
Fri, 17 Oct 2014 02:10:33 +0000 (02:10 +0000)
an invalid combination of words; don't accidentally
continue trying to parse the command line.
clang static analysis fixit.

llvm-svn: 220026

lldb/source/Commands/CommandObjectSyntax.cpp

index d2021ea..5093c3b 100644 (file)
@@ -69,12 +69,18 @@ CommandObjectSyntax::DoExecute (Args& command, CommandReturnObject &result)
         {
             std::string sub_command = command.GetArgumentAtIndex (i);
             if (!cmd_obj->IsMultiwordObject())
+            {
                 all_okay = false;
+                break;
+            }
             else
             {
                 cmd_obj = cmd_obj->GetSubcommandObject(sub_command.c_str());
                 if (!cmd_obj)
+                {
                     all_okay = false;
+                    break;
+                }
             }
         }