From 5efd728e9b2c3500ac72aa005314929e64774efe Mon Sep 17 00:00:00 2001 From: Thomas R Date: Thu, 13 Jan 2022 10:50:08 +0100 Subject: [PATCH] hey --- src/configManagement.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/configManagement.cpp b/src/configManagement.cpp index 0878b41..de9c456 100644 --- a/src/configManagement.cpp +++ b/src/configManagement.cpp @@ -73,23 +73,24 @@ void ConfigBuilder::parseFile(const string& fname) { internalValues[fullKey] = value; }else{ + listIndex = 0; + match = line.find(':'); if (match == string::npos)throw config_error("Line "+ to_string(lineno)+" invalid : |"+line+"|"); - string key = line.substr(0, match); + string localKey = line.substr(0, match); string value = line.substr(match + 1); - trimSpaces(key); + trimSpaces(localKey); sanitizeValue(value); if (value.empty()) { keyParts.resize(currentIndent); - keyParts.push_back(key); - listIndex = 0; + keyParts.push_back(localKey); } else { string fullKey; for (unsigned i = 0; i < currentIndent; ++i) { fullKey.append(keyParts[i]); fullKey.append("."); } - fullKey.append(key); + fullKey.append(localKey); internalValues[fullKey] = value; } }