summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2022-07-12 10:28:42 +0200
committervaxerski <43317083+vaxerski@users.noreply.github.com>2022-07-12 10:28:42 +0200
commit2d856ac4b08826ff83c42e97176f4f739442aefa (patch)
tree3dd3bebee0d884653c4596f05f0d49e9eed748b8 /src
parent29e2bb27f6073695aa4f9767f87cd653db5ce811 (diff)
Added yes/no values to int parsing
Diffstat (limited to 'src')
-rw-r--r--src/config/ConfigManager.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp
index f4a2d003..077627aa 100644
--- a/src/config/ConfigManager.cpp
+++ b/src/config/ConfigManager.cpp
@@ -201,7 +201,12 @@ void CConfigManager::configSetValueSafe(const std::string& COMMAND, const std::s
// Values with 0x are hex
const auto VALUEWITHOUTHEX = VALUE.substr(2);
CONFIGENTRY->intValue = stol(VALUEWITHOUTHEX, nullptr, 16);
- } else
+ } else if (VALUE.find("true") == 0 || VALUE.find("on") == 0 || VALUE.find("yes") == 0) {
+ CONFIGENTRY->intValue = 1;
+ } else if (VALUE.find("false") == 0 || VALUE.find("off") == 0 || VALUE.find("no") == 0) {
+ CONFIGENTRY->intValue = 0;
+ }
+ else
CONFIGENTRY->intValue = stol(VALUE);
} catch (...) {
Debug::log(WARN, "Error reading value of %s", COMMAND.c_str());