summaryrefslogtreecommitdiff
path: root/Source/Core/Common/IniFile.cpp
diff options
context:
space:
mode:
authorcomex <comexk@gmail.com>2015-06-02 19:04:04 -0400
committercomex <comexk@gmail.com>2015-06-02 19:04:04 -0400
commit35ca27f1cddedf537dfe3f69f0a9ca422fa6b1e0 (patch)
tree7bd1aab7f0465f03fe4ba4dc2c750a6acf1fcb62 /Source/Core/Common/IniFile.cpp
parenta3b3f0522bce40ed6613ab97c1a64fe825b4ed66 (diff)
Fix bug where Gecko codes would be "enabled by default"
Actually caused by IniFiles::GetLines leaving the output vector in its old state if the section wasn't found, and Gecko::LoadCodes not checking the return value. Fix by moving lines->clear() up.
Diffstat (limited to 'Source/Core/Common/IniFile.cpp')
-rw-r--r--Source/Core/Common/IniFile.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/Source/Core/Common/IniFile.cpp b/Source/Core/Common/IniFile.cpp
index 3d41ff659d..dda4f5e115 100644
--- a/Source/Core/Common/IniFile.cpp
+++ b/Source/Core/Common/IniFile.cpp
@@ -262,11 +262,12 @@ bool IniFile::GetKeys(const std::string& sectionName, std::vector<std::string>*
// Return a list of all lines in a section
bool IniFile::GetLines(const std::string& sectionName, std::vector<std::string>* lines, const bool remove_comments) const
{
+ lines->clear();
+
const Section* section = GetSection(sectionName);
if (!section)
return false;
- lines->clear();
for (std::string line : section->lines)
{
line = StripSpaces(line);