diff options
Diffstat (limited to 'third_party/nix/src/libstore/machines.cc')
-rw-r--r-- | third_party/nix/src/libstore/machines.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/third_party/nix/src/libstore/machines.cc b/third_party/nix/src/libstore/machines.cc index 2f1a7289bd84..6472e037d14c 100644 --- a/third_party/nix/src/libstore/machines.cc +++ b/third_party/nix/src/libstore/machines.cc @@ -2,6 +2,8 @@ #include <algorithm> +#include <absl/strings/ascii.h> +#include <absl/strings/string_view.h> #include <glog/logging.h> #include "globals.hh" @@ -48,14 +50,13 @@ bool Machine::mandatoryMet(const std::set<std::string>& features) const { void parseMachines(const std::string& s, Machines& machines) { for (auto line : tokenizeString<std::vector<std::string>>(s, "\n;")) { - trim(line); line.erase(std::find(line.begin(), line.end(), '#'), line.end()); if (line.empty()) { continue; } if (line[0] == '@') { - auto file = trim(std::string(line, 1)); + auto file = absl::StripAsciiWhitespace(std::string(line, 1)); try { parseMachines(readFile(file), machines); } catch (const SysError& e) { |