From 6bdc45e9cec9aca56aa676a4e185e58b5d82c7e9 Mon Sep 17 00:00:00 2001 From: Legorel Date: Mon, 25 Sep 2023 00:11:34 +0200 Subject: [PATCH] config: restore configCurrenPath after sourcing file (#3339) --- src/config/ConfigManager.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index 3d231dbd..2eaee318 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -1239,6 +1239,8 @@ void CConfigManager::handleSource(const std::string& command, const std::string& std::string line = ""; int linenum = 1; if (ifs.is_open()) { + auto configCurrentPathBackup = configCurrentPath; + while (std::getline(ifs, line)) { // Read line by line. try { @@ -1259,6 +1261,8 @@ void CConfigManager::handleSource(const std::string& command, const std::string& } ifs.close(); + + configCurrentPath = configCurrentPathBackup; } } }