about summary refs log tree commit diff
path: root/third_party/nix/src/libutil
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/nix/src/libutil')
-rw-r--r--third_party/nix/src/libutil/config.cc4
-rw-r--r--third_party/nix/src/libutil/util.cc2
2 files changed, 3 insertions, 3 deletions
diff --git a/third_party/nix/src/libutil/config.cc b/third_party/nix/src/libutil/config.cc
index 5d28b7a20fd3..7c6e7af48752 100644
--- a/third_party/nix/src/libutil/config.cc
+++ b/third_party/nix/src/libutil/config.cc
@@ -262,7 +262,7 @@ void BaseSetting<bool>::convertToArg(Args& args, const std::string& category) {
 
 template <>
 void BaseSetting<Strings>::set(const std::string& str) {
-  value = absl::StrSplit(str, absl::ByAnyChar(" \t\n\r"));
+  value = absl::StrSplit(str, absl::ByAnyChar(" \t\n\r"), absl::SkipEmpty());
 }
 
 template <>
@@ -280,7 +280,7 @@ void BaseSetting<Strings>::toJSON(JSONPlaceholder& out) {
 
 template <>
 void BaseSetting<StringSet>::set(const std::string& str) {
-  value = absl::StrSplit(str, absl::ByAnyChar(" \t\n\r"));
+  value = absl::StrSplit(str, absl::ByAnyChar(" \t\n\r"), absl::SkipEmpty());
 }
 
 template <>
diff --git a/third_party/nix/src/libutil/util.cc b/third_party/nix/src/libutil/util.cc
index 75a8e73eac77..3e88fd29b9f0 100644
--- a/third_party/nix/src/libutil/util.cc
+++ b/third_party/nix/src/libutil/util.cc
@@ -547,7 +547,7 @@ std::vector<Path> getConfigDirs() {
   Path configHome = getConfigDir();
   std::string configDirs = getEnv("XDG_CONFIG_DIRS");
   std::vector<std::string> result =
-      absl::StrSplit(configDirs, absl::ByChar(':'));
+      absl::StrSplit(configDirs, absl::ByChar(':'), absl::SkipEmpty());
   result.insert(result.begin(), configHome);
   return result;
 }