<rdar://problem/11052829>

Fixed a case where if you have a argument stirng that ends with a '\' character, it would infinite loop while consuming all of your memory.

Also fixed a case where non-quote terminated strings would inefficiently be handled.

llvm-svn: 152809
This commit is contained in:
Greg Clayton 2012-03-15 17:10:48 +00:00
parent b31e3af6fb
commit 0c94313d20
1 changed files with 8 additions and 0 deletions

View File

@ -225,6 +225,7 @@ Args::SetCommandString (const char *command)
{
case '\0':
arg.append (arg_piece_start);
++arg_end;
arg_complete = true;
break;
@ -311,6 +312,13 @@ Args::SetCommandString (const char *command)
}
quote_char = '\0';
}
else
{
// Consume the rest of the string as there was no terminating quote
arg.append(arg_piece_start);
arg_end = arg_piece_start + strlen(arg_piece_start);
arg_complete = true;
}
}
break;