diff --git a/src/config.cpp b/src/config.cpp index b93baf3..de61ae5 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -263,7 +263,9 @@ CParseResult CConfig::configSetValueSafe(const std::string& command, const std:: valueName += command; - auto VALUEIT = impl->values.find(valueName); + const auto VALUEONLYNAME = valueName.contains(":") ? valueName.substr(valueName.find_last_of(':') + 1) : valueName; + + auto VALUEIT = impl->values.find(valueName); if (VALUEIT == impl->values.end()) { // it might be in a special category bool found = false; @@ -290,6 +292,10 @@ CParseResult CConfig::configSetValueSafe(const std::string& command, const std:: if (sc->key.empty() || !valueName.starts_with(sc->name)) continue; + // category does exist, check if value exists + if (!sc->defaultValues.contains(VALUEONLYNAME) && VALUEONLYNAME != sc->key) + break; + // bingo const auto PCAT = impl->specialCategories.emplace_back(std::make_unique()).get(); PCAT->descriptor = sc.get();