Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
magcius committed Aug 11, 2013
1 parent 0eaea5f commit b5c2737
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
7 changes: 1 addition & 6 deletions Source/Core/Common/Src/IniFile.cpp
Expand Up @@ -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
Expand Down Expand Up @@ -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<std::string>::const_iterator liter = section.lines.begin(); liter != section.lines.end(); ++liter)
Expand Down
1 change: 0 additions & 1 deletion Source/Core/Common/Src/IniFile.h
Expand Up @@ -70,7 +70,6 @@ class IniFile
protected:
std::vector<std::string> lines;
std::string name;
std::string comment;
};

bool Load(const char* filename);
Expand Down

0 comments on commit b5c2737

Please sign in to comment.