diff options
Diffstat (limited to 'third_party/nix/src/nix/run.cc')
-rw-r--r-- | third_party/nix/src/nix/run.cc | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/third_party/nix/src/nix/run.cc b/third_party/nix/src/nix/run.cc index 5459c38952d4..9827360f0aa9 100644 --- a/third_party/nix/src/nix/run.cc +++ b/third_party/nix/src/nix/run.cc @@ -96,7 +96,7 @@ struct CmdRun : InstallablesCommand { std::map<std::string, std::string> kept; for (auto& var : keep) { auto s = getenv(var.c_str()); - if (s) { + if (s != nullptr) { kept[var] = s; } } @@ -133,9 +133,7 @@ struct CmdRun : InstallablesCommand { continue; } - if (true) { - unixPath.push_front(path + "/bin"); - } + { unixPath.push_front(path + "/bin"); } auto propPath = path + "/nix-support/propagated-user-env-packages"; if (accessor->stat(propPath).type == FSAccessor::tRegular) { @@ -249,7 +247,7 @@ void chrootHelper(int argc, char** argv) { } char* cwd = getcwd(nullptr, 0); - if (!cwd) { + if (cwd == nullptr) { throw SysError("getting current directory"); } Finally freeCwd([&]() { free(cwd); }); |