Commit 1f24d6d7 authored by Dominik Charousset's avatar Dominik Charousset

Allow users to omit "global." suffix

parent a6fa018c
......@@ -457,8 +457,12 @@ optional<T> get_if(const std::map<std::string, config_value::dictionary>* xs,
const std::string& name) {
// Get the category.
auto pos = name.find('.');
if (pos == std::string::npos)
return none;
if (pos == std::string::npos) {
auto i = xs->find("global");
if (i == xs->end())
return none;
return get_if<T>(&i->second, name);
}
auto i = xs->find(name.substr(0, pos));
if (i == xs->end())
return none;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment