diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2019-11-22 16:06:44 +0100 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2019-11-22 16:18:13 +0100 |
commit | ba87b08f8529e4d9f8c58d8c625152058ceadb75 (patch) | |
tree | c78196cbeb52273c3d5b99ff8dee314108940b9a /src/nix-env/nix-env.cc | |
parent | fd900c45b5ff9c6dc7f3ec814eca4ad603720899 (diff) |
getEnv(): Return std::optional
This allows distinguishing between an empty value and no value.
Diffstat (limited to 'src/nix-env/nix-env.cc')
-rw-r--r-- | src/nix-env/nix-env.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nix-env/nix-env.cc b/src/nix-env/nix-env.cc index 199dc92aa..a9c743955 100644 --- a/src/nix-env/nix-env.cc +++ b/src/nix-env/nix-env.cc @@ -1425,7 +1425,7 @@ static int _main(int argc, char * * argv) globals.instSource.autoArgs = myArgs.getAutoArgs(*globals.state); if (globals.profile == "") - globals.profile = getEnv("NIX_PROFILE", ""); + globals.profile = getEnv("NIX_PROFILE").value_or(""); if (globals.profile == "") { Path profileLink = getHome() + "/.nix-profile"; |