diff options
Diffstat (limited to 'third_party/nix/src/nix/doctor.cc')
-rw-r--r-- | third_party/nix/src/nix/doctor.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/third_party/nix/src/nix/doctor.cc b/third_party/nix/src/nix/doctor.cc index 97c31d0376f1..0105b05e97fc 100644 --- a/third_party/nix/src/nix/doctor.cc +++ b/third_party/nix/src/nix/doctor.cc @@ -48,7 +48,8 @@ struct CmdDoctor final : StoreCommand { static bool checkNixInPath() { PathSet dirs; - for (auto& dir : absl::StrSplit(getEnv("PATH"), absl::ByChar(':'))) { + for (auto& dir : + absl::StrSplit(getEnv("PATH"), absl::ByChar(':'), absl::SkipEmpty())) { if (pathExists(absl::StrCat(dir, "/nix-env"))) { dirs.insert(dirOf(canonPath(absl::StrCat(dir, "/nix-env"), true))); } @@ -71,7 +72,8 @@ struct CmdDoctor final : StoreCommand { static bool checkProfileRoots(const ref<Store>& store) { PathSet dirs; - for (auto dir : absl::StrSplit(getEnv("PATH"), absl::ByChar(':'))) { + for (auto dir : + absl::StrSplit(getEnv("PATH"), absl::ByChar(':'), absl::SkipEmpty())) { Path profileDir = dirOf(dir); try { Path userEnv = canonPath(profileDir, true); |