[Base] Fix checks in cvar string escaping.
This commit is contained in:
parent
ce8d3cb978
commit
35e79d1979
|
@ -159,9 +159,9 @@ std::string EscapeString(const std::string& val) {
|
||||||
"\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F"
|
"\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F"
|
||||||
"'"
|
"'"
|
||||||
"\x7F";
|
"\x7F";
|
||||||
if (val.find_first_of("\r\n") == std::string::npos) {
|
if (val.find_first_of(multiline_chars) == std::string::npos) {
|
||||||
// single line
|
// single line
|
||||||
if (val.find_first_of(multiline_chars) == std::string::npos) {
|
if (val.find_first_of(escape_chars) == std::string::npos) {
|
||||||
return "'" + val + "'";
|
return "'" + val + "'";
|
||||||
} else {
|
} else {
|
||||||
return "\"" + toml::EscapeBasicString(val) + "\"";
|
return "\"" + toml::EscapeBasicString(val) + "\"";
|
||||||
|
|
Loading…
Reference in New Issue