CLI2: Simplify code by using const quote string
The "\'" string is equal to "'", which is already stored in the quote variable, so we might as well use that. Thanks to Sebastian Uharek for the review suggestion.
This commit is contained in:
@@ -418,7 +418,7 @@ void CLI2::lexArguments ()
|
||||
// Process multiple-token arguments.
|
||||
else
|
||||
{
|
||||
std::string quote = "'";
|
||||
const std::string quote = "'";
|
||||
|
||||
// Escape unescaped single quotes
|
||||
std::string escaped = "";
|
||||
@@ -434,7 +434,7 @@ void CLI2::lexArguments ()
|
||||
if (!nextEscaped && (character == "\\"))
|
||||
nextEscaped = true;
|
||||
else {
|
||||
if (character == "\'" && !nextEscaped)
|
||||
if (character == quote && !nextEscaped)
|
||||
escaped += "\\";
|
||||
nextEscaped = false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user