CLI2: Corrected str_replace calls

This commit is contained in:
Paul Beckingham 2016-12-11 16:09:16 -05:00
parent 4232f1a599
commit f0988b52d0

View file

@ -399,6 +399,7 @@ void CLI2::lexArguments ()
{
bool quoted = Lexer::wasQuoted (_original_args[i].attribute ("raw"));
// Process single-token arguments.
std::string lexeme;
Lexer::Type type;
Lexer lex (_original_args[i].attribute ("raw"));
@ -422,11 +423,13 @@ void CLI2::lexArguments ()
_args.push_back (a);
}
// Process muktiple-token arguments.
else
{
std::string quote = "'";
std::string escaped = _original_args[i].attribute ("raw");
str_replace (escaped, quote, "\\'");
escaped = str_replace (escaped, quote, "\\'");
std::string::size_type cursor = 0;
std::string word;