Skip to content
Snippets Groups Projects
Commit d4c6d0d9 authored by Oliver Sander's avatar Oliver Sander
Browse files

Bugfix. Leading and trailing whitespace wasn't cropped properly.

Patch provided by Carsten Gräser.

[[Imported from SVN: r5030]]
parent b2d2554a
No related branches found
No related tags found
No related merge requests found
......@@ -275,13 +275,13 @@ namespace Dune {
string ConfigParser::trim(string s)
{
int i = 0;
while (s[i] == ' ')
while ((s[i] == ' ')or (s[i] == '\n') or (s[i] == '\r'))
i++;
s.erase(0,i);
i = s.length();
while (s[i-1] == ' ')
while ((s[i-1] == ' ')or (s[i-1] == '\n') or (s[i-1] == '\r'))
i--;
s.erase(i);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment