allow quotation marks inside config options

This commit is contained in:
Andrzej Rybczak
2009-05-21 22:42:36 +02:00
parent eb3b08b45e
commit 3d9c242f4d
2 changed files with 10 additions and 2 deletions

View File

@@ -288,12 +288,20 @@ string GetLineValue(string &line, char a, char b, bool once)
size_t i;
for (i = line.find(a); i != string::npos && pos[1] < 0; i = line.find(b, i))
{
if (i && line[i-1] == '\\')
{
i++;
continue;
}
if (once)
line[i] = 0;
pos[pos[0] >= 0] = i++;
}
pos[0]++;
return pos[0] >= 0 && pos[1] >= 0 ? line.substr(pos[0], pos[1]-pos[0]) : "";
string result = pos[0] >= 0 && pos[1] >= 0 ? line.substr(pos[0], pos[1]-pos[0]) : "";
for (i = result.find("\\\""); i != string::npos; i = result.find("\\\""))
result.replace(i, 2, "\"");
return result;
}
void RemoveTheWord(string &s)