about summary refs log tree commit diff
path: root/third_party/nix/src/libexpr
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/nix/src/libexpr')
-rw-r--r--third_party/nix/src/libexpr/primops.cc3
-rw-r--r--third_party/nix/src/libexpr/primops/fetchGit.cc6
-rw-r--r--third_party/nix/src/libexpr/primops/fetchMercurial.cc14
3 files changed, 14 insertions, 9 deletions
diff --git a/third_party/nix/src/libexpr/primops.cc b/third_party/nix/src/libexpr/primops.cc
index fa00570417..8ade52bd91 100644
--- a/third_party/nix/src/libexpr/primops.cc
+++ b/third_party/nix/src/libexpr/primops.cc
@@ -4,6 +4,7 @@
 #include <cstring>
 #include <regex>
 
+#include <absl/strings/str_split.h>
 #include <dlfcn.h>
 #include <glog/logging.h>
 #include <sys/stat.h>
@@ -712,7 +713,7 @@ static void prim_derivationStrict(EvalState& state, const Pos& pos,
           } else if (i->name == state.sOutputHashMode) {
             handleHashMode(s);
           } else if (i->name == state.sOutputs) {
-            handleOutputs(tokenizeString<Strings>(s));
+            handleOutputs(absl::StrSplit(s, absl::ByAnyChar(" \t\n\r")));
           }
         }
       }
diff --git a/third_party/nix/src/libexpr/primops/fetchGit.cc b/third_party/nix/src/libexpr/primops/fetchGit.cc
index 99f1c3c4ba..2cfdefe7ab 100644
--- a/third_party/nix/src/libexpr/primops/fetchGit.cc
+++ b/third_party/nix/src/libexpr/primops/fetchGit.cc
@@ -3,6 +3,7 @@
 
 #include <absl/strings/ascii.h>
 #include <absl/strings/match.h>
+#include <absl/strings/str_split.h>
 #include <glog/logging.h>
 #include <sys/time.h>
 
@@ -54,8 +55,9 @@ GitInfo exportGit(ref<Store> store, const std::string& uri,
       gitInfo.rev = "0000000000000000000000000000000000000000";
       gitInfo.shortRev = std::string(gitInfo.rev, 0, 7);
 
-      auto files = tokenizeString<std::set<std::string>>(
-          runProgram("git", true, {"-C", uri, "ls-files", "-z"}), "\0"s);
+      std::set<std::string> files =
+          absl::StrSplit(runProgram("git", true, {"-C", uri, "ls-files", "-z"}),
+                         absl::ByChar('\0'));
 
       PathFilter filter = [&](const Path& p) -> bool {
         assert(absl::StartsWith(p, uri));
diff --git a/third_party/nix/src/libexpr/primops/fetchMercurial.cc b/third_party/nix/src/libexpr/primops/fetchMercurial.cc
index b6d4a5e1c8..71722faedf 100644
--- a/third_party/nix/src/libexpr/primops/fetchMercurial.cc
+++ b/third_party/nix/src/libexpr/primops/fetchMercurial.cc
@@ -3,6 +3,7 @@
 
 #include <absl/strings/ascii.h>
 #include <absl/strings/match.h>
+#include <absl/strings/str_split.h>
 #include <glog/logging.h>
 #include <sys/time.h>
 
@@ -48,11 +49,11 @@ HgInfo exportMercurial(ref<Store> store, const std::string& uri,
       hgInfo.branch = absl::StripTrailingAsciiWhitespace(
           runProgram("hg", true, {"branch", "-R", uri}));
 
-      auto files = tokenizeString<std::set<std::string>>(
+      std::set<std::string> files = absl::StrSplit(
           runProgram("hg", true,
                      {"status", "-R", uri, "--clean", "--modified", "--added",
                       "--no-status", "--print0"}),
-          "\0"s);
+          absl::ByChar('\0'));
 
       PathFilter filter = [&](const Path& p) -> bool {
         assert(absl::StartsWith(p, uri));
@@ -124,10 +125,11 @@ HgInfo exportMercurial(ref<Store> store, const std::string& uri,
     writeFile(stampFile, "");
   }
 
-  auto tokens = tokenizeString<std::vector<std::string>>(
-      runProgram("hg", true,
-                 {"log", "-R", cacheDir, "-r", rev, "--template",
-                  "{node} {rev} {branch}"}));
+  std::vector<std::string> tokens =
+      absl::StrSplit(runProgram("hg", true,
+                                {"log", "-R", cacheDir, "-r", rev, "--template",
+                                 "{node} {rev} {branch}"}),
+                     absl::ByAnyChar(" \t\n\r"));
   assert(tokens.size() == 3);
 
   HgInfo hgInfo;