From b5c2737c9f1300b82d5f4b4ae937e1b58e6d171a Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Sun, 11 Aug 2013 10:55:06 -0400 Subject: [PATCH] IniFile: Don't parse comments after the [Section] brackets This is non-standard behavior. We won't fail to parse, but we now won't write them back out either. --- Source/Core/Common/Src/IniFile.cpp | 7 +------ Source/Core/Common/Src/IniFile.h | 1 - 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/Source/Core/Common/Src/IniFile.cpp b/Source/Core/Common/Src/IniFile.cpp index 89741b5e3c..2eca8df929 100644 --- a/Source/Core/Common/Src/IniFile.cpp +++ b/Source/Core/Common/Src/IniFile.cpp @@ -406,11 +406,6 @@ bool IniFile::Load(const char* filename) // New section! std::string sub = line.substr(1, endpos - 1); sections.push_back(Section(sub)); - - if (endpos + 1 < line.size()) - { - sections[sections.size() - 1].comment = line.substr(endpos + 1); - } } } else @@ -444,7 +439,7 @@ bool IniFile::Save(const char* filename) if (section.name != "") { - out << "[" << section.name << "]" << section.comment << std::endl; + out << "[" << section.name << "]" << std::endl; } for (std::vector::const_iterator liter = section.lines.begin(); liter != section.lines.end(); ++liter) diff --git a/Source/Core/Common/Src/IniFile.h b/Source/Core/Common/Src/IniFile.h index cc4d1515be..bad26ca090 100644 --- a/Source/Core/Common/Src/IniFile.h +++ b/Source/Core/Common/Src/IniFile.h @@ -70,7 +70,6 @@ public: protected: std::vector lines; std::string name; - std::string comment; }; bool Load(const char* filename);