diff --git a/src/libutil/config.cc b/src/libutil/config.cc index be957dfe3..7af3e7883 100644 --- a/src/libutil/config.cc +++ b/src/libutil/config.cc @@ -291,7 +291,14 @@ template<> std::string BaseSetting::to_string() const template<> void BaseSetting::set(const std::string & str, bool append) { - value = tokenizeString(str); + if (!append) value.clear(); + for (auto & s : tokenizeString(str)) + value.insert(s); +} + +template<> bool BaseSetting::isAppendable() +{ + return true; } template<> std::string BaseSetting::to_string() const @@ -302,9 +309,7 @@ template<> std::string BaseSetting::to_string() const template<> void BaseSetting::set(const std::string & str, bool append) { if (!append) value.clear(); - auto kvpairs = tokenizeString(str); - for (auto & s : kvpairs) - { + for (auto & s : tokenizeString(str)) { auto eq = s.find_first_of('='); if (std::string::npos != eq) value.emplace(std::string(s, 0, eq), std::string(s, eq + 1));