diff options
Diffstat (limited to 'src/filesystem')
-rw-r--r-- | src/filesystem/inistream.cc | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/filesystem/inistream.cc b/src/filesystem/inistream.cc index 0235440..94cb032 100644 --- a/src/filesystem/inistream.cc +++ b/src/filesystem/inistream.cc @@ -66,17 +66,16 @@ bool IniStream::getline(std::istream & istream) aux::trim(s); line_number++; - if (s.size() == 0) { - // empty line - } else + if (s.size() > 0) { // strip trailing EOL / FF characters - if ( (s[s.size() -1] == 0x0a) || (s[s.size() -1] == 0x0d)) + if ( (s[s.size() -1] == 0x0a) || (s[s.size() -1] == 0x0d)) { s.erase(s.size() -1); + } // comment if (s[0] == '#' || s[0] == ';') { // condebug << "IniStream got comment " << s << std::endl; - } else + } else { // section header if (s.size() > 2 && s[0] == '[' && s[s.size()-1] == ']') { // condebug << "Inifile got section header " << s << std::endl; @@ -107,9 +106,12 @@ bool IniStream::getline(std::istream & istream) } } + } + } return true; - } else + } else { return false; + } } bool IniStream::got_key() const |