From 573cb0d4e062fbdec5c49169c2885a07ea91b726 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Sat, 27 Aug 2022 23:12:01 +0200 Subject: [PATCH] fix parser in nested categories --- src/config/ConfigManager.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index 460d024f..a502423b 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -935,7 +935,14 @@ void CConfigManager::parseLine(std::string& line) { } if (line.contains("}") && currentCategory != "") { - currentCategory = ""; + + const auto LASTSEP = currentCategory.find_last_of(':'); + + if (LASTSEP == std::string::npos) + currentCategory = ""; + else + currentCategory = currentCategory.substr(0, LASTSEP); + return; }