Use unescape rather than a regex in command manager parsing

This commit is contained in:
Maxime Coste 2014-11-04 13:35:54 +00:00
parent 97df59ddb7
commit 60c1bb1315

View File

@ -254,10 +254,10 @@ TokenList parse(StringView line)
++pos;
if (start_pos != pos)
{
String token = line.substr(token_start, pos - token_start);
static const Regex regex{R"(\\([ \t;\n]))"};
result.emplace_back(Token::Type::Raw, token_start, pos,
regex_replace(token, regex, "\\1"));
result.emplace_back(
Token::Type::Raw, token_start, pos,
unescape(line.substr(token_start, pos - token_start),
" \t;\n", '\\'));
}
}