Fix of escape_strings_cstyle(), which did not enclose a single word

string containing semicolon ';' character into quotes.
This commit is contained in:
Vojtech Bubnik 2022-01-26 13:18:52 +01:00
parent e20a06a850
commit e83d89dee7

View File

@ -73,7 +73,7 @@ std::string escape_strings_cstyle(const std::vector<std::string> &strs)
bool should_quote = strs.size() == 1 && str.empty();
for (size_t i = 0; i < str.size(); ++ i) {
char c = str[i];
if (c == ' ' || c == '\t' || c == '\\' || c == '"' || c == '\r' || c == '\n') {
if (c == ' ' || c == ';' || c == '\t' || c == '\\' || c == '"' || c == '\r' || c == '\n') {
should_quote = true;
break;
}