Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nix
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 387f824cab50
Choose a base ref
...
head repository: NixOS/nix
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: b87f84cf55b4
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Nov 9, 2020

  1. Fix appending to Setting<StringSet>

    Fixes: warning: unknown setting 'extra-sandbox-paths'
    edolstra committed Nov 9, 2020
    2
    Copy the full SHA
    b87f84c View commit details
Showing with 9 additions and 4 deletions.
  1. +9 −4 src/libutil/config.cc
13 changes: 9 additions & 4 deletions src/libutil/config.cc
Original file line number Diff line number Diff line change
@@ -291,7 +291,14 @@ template<> std::string BaseSetting<Strings>::to_string() const

template<> void BaseSetting<StringSet>::set(const std::string & str, bool append)
{
value = tokenizeString<StringSet>(str);
if (!append) value.clear();
for (auto & s : tokenizeString<StringSet>(str))
value.insert(s);
}

template<> bool BaseSetting<StringSet>::isAppendable()
{
return true;
}

template<> std::string BaseSetting<StringSet>::to_string() const
@@ -302,9 +309,7 @@ template<> std::string BaseSetting<StringSet>::to_string() const
template<> void BaseSetting<StringMap>::set(const std::string & str, bool append)
{
if (!append) value.clear();
auto kvpairs = tokenizeString<Strings>(str);
for (auto & s : kvpairs)
{
for (auto & s : tokenizeString<Strings>(str)) {
auto eq = s.find_first_of('=');
if (std::string::npos != eq)
value.emplace(std::string(s, 0, eq), std::string(s, eq + 1));