From 02384842be1a0877e1bfecc0c0412e31a566af7a Mon Sep 17 00:00:00 2001 From: JustinAJ Date: Thu, 5 Jun 2014 02:05:40 -0400 Subject: [PATCH] Fixed closing bracket not being removed from section. --- Jupiter/INIFile.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Jupiter/INIFile.cpp b/Jupiter/INIFile.cpp index f1f582c..20c93ca 100644 --- a/Jupiter/INIFile.cpp +++ b/Jupiter/INIFile.cpp @@ -263,11 +263,12 @@ unsigned int Jupiter::INIFile::readFile(const char *fileName) { line.shiftRight(1); - while (line.size() != 0 && line.get(line.size() - 1) != ']') // This also inadvertently adds support for comments on section lines! + // Truncate up to the last ']'. + while (line.size() != 0 && line.get(line.size() - 1) != ']') line.truncate(1); + line.truncate(1); // Truncate the ']' we stoped at. - if (line.size() != 0) - section.set(line); + section.set(line); } else if (line.contains('=')) // key/value pair. {