Fixing a crashing bug in multiword commands from William Lynch.

llvm-svn: 108958
This commit is contained in:
Greg Clayton 2010-07-20 22:54:09 +00:00
parent 471b31ce62
commit ede0585ec2
1 changed files with 2 additions and 3 deletions

View File

@ -290,13 +290,12 @@ CommandObjectMultiword::HandleCompletion
const char *
CommandObjectMultiword::GetRepeatCommand (Args &current_command_args, uint32_t index)
{
if (current_command_args.GetArgumentCount() == 0)
return NULL;
index++;
if (current_command_args.GetArgumentCount() <= index)
return NULL;
CommandObject *sub_command_object = GetSubcommandObject (current_command_args.GetArgumentAtIndex(index));
if (sub_command_object == NULL)
return NULL;
else
return sub_command_object->GetRepeatCommand(current_command_args, index);
}