diff options
| author | Rachel Bryk <RachelBryk@gmail.com> | 2014-05-28 12:18:28 -0400 |
|---|---|---|
| committer | Rachel Bryk <RachelBryk@gmail.com> | 2014-05-28 14:06:18 -0400 |
| commit | 80ab567a5badc64779b3441319912fbfe19eeef7 (patch) | |
| tree | 5972ce26173f4ac46321337bf6620726b157b3c8 /Source/Core/Common/IniFile.cpp | |
| parent | 10efd5b8c031cd2e3f74fbc956d90138498e6c0d (diff) | |
When reading an ini file, if there is an error, check if it is simply because the eof was reached.
Diffstat (limited to 'Source/Core/Common/IniFile.cpp')
| -rw-r--r-- | Source/Core/Common/IniFile.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Source/Core/Common/IniFile.cpp b/Source/Core/Common/IniFile.cpp index 1fc302bac8..0424e20014 100644 --- a/Source/Core/Common/IniFile.cpp +++ b/Source/Core/Common/IniFile.cpp @@ -347,9 +347,16 @@ bool IniFile::Load(const std::string& filename, bool keep_current_data) char templine[MAX_BYTES]; std::string line; if (in.getline(templine, MAX_BYTES)) + { line = templine; + } else - return false; + { + if (in.eof()) + return true; + else + return false; + } #ifndef _WIN32 // Check for CRLF eol and convert it to LF |
