settings: compare config option/key names properly

This commit is contained in:
Andrzej Rybczak
2011-11-12 20:25:18 +01:00
parent 56467eaac6
commit 0e883db375
2 changed files with 211 additions and 195 deletions

View File

@@ -311,13 +311,15 @@ void Trim(std::string &s)
size_t b = 0;
size_t e = s.length()-1;
while (s[b] == ' ' || s[b] == '\n')
++b;
while (s[e] == ' ' || s[e] == '\n')
--e;
++e;
if (e != s.length())
s.resize(e);
if (b != 0 || e != s.length()-1)
s = s.substr(b, e-b);
while (s[b] == ' ' || s[b] == '\n')
++b;
if (b != 0)
s = s.substr(b);
}