summaryrefslogtreecommitdiff
path: root/Source/Core/Common/Src/IniFile.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Core/Common/Src/IniFile.cpp')
-rw-r--r--Source/Core/Common/Src/IniFile.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/Source/Core/Common/Src/IniFile.cpp b/Source/Core/Common/Src/IniFile.cpp
index c44da39e94..09a3aca415 100644
--- a/Source/Core/Common/Src/IniFile.cpp
+++ b/Source/Core/Common/Src/IniFile.cpp
@@ -273,7 +273,7 @@ bool IniFile::Load(const char* filename)
sections.clear();
sections.push_back(Section(""));
- //first section consists of the comments before the first real section
+ // first section consists of the comments before the first real section
// Open file
std::ifstream in;
@@ -289,6 +289,14 @@ bool IniFile::Load(const char* filename)
char templine[MAX_BYTES];
in.getline(templine, MAX_BYTES);
std::string line = templine;
+
+#ifndef _WIN32
+ // Check for CRLF eol and convert it to LF
+ if (!line.empty() && line.at(line.size()-1) == '\r')
+ {
+ line.erase(line.size()-1);
+ }
+#endif
if (in.eof())
{