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.
This commit is contained in:
Jasper St. Pierre 2013-08-11 10:55:06 -04:00
parent 0eaea5f4df
commit b5c2737c9f
2 changed files with 1 additions and 7 deletions

View file

@ -406,11 +406,6 @@ bool IniFile::Load(const char* filename)
// New section! // New section!
std::string sub = line.substr(1, endpos - 1); std::string sub = line.substr(1, endpos - 1);
sections.push_back(Section(sub)); sections.push_back(Section(sub));
if (endpos + 1 < line.size())
{
sections[sections.size() - 1].comment = line.substr(endpos + 1);
}
} }
} }
else else
@ -444,7 +439,7 @@ bool IniFile::Save(const char* filename)
if (section.name != "") if (section.name != "")
{ {
out << "[" << section.name << "]" << section.comment << std::endl; out << "[" << section.name << "]" << std::endl;
} }
for (std::vector<std::string>::const_iterator liter = section.lines.begin(); liter != section.lines.end(); ++liter) for (std::vector<std::string>::const_iterator liter = section.lines.begin(); liter != section.lines.end(); ++liter)

View file

@ -70,7 +70,6 @@ public:
protected: protected:
std::vector<std::string> lines; std::vector<std::string> lines;
std::string name; std::string name;
std::string comment;
}; };
bool Load(const char* filename); bool Load(const char* filename);