From 785cb3a75476033ba6eec2fef334d47d8e64388a Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 22 Nov 2019 16:06:44 +0100 Subject: refactor(tvix): getEnv(): Return std::optional This allows distinguishing between an empty value and no value. Patch ported from upstream at https://github.com/NixOS/nix/commit/ba87b08f8529e4d9f8c58d8c625152058ceadb75 Change-Id: I061cc8e16b1a7a0341adfc3b0edca1c0c51d5c97 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1884 Tested-by: BuildkiteCI Reviewed-by: kanepyork --- third_party/nix/src/libutil/util.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'third_party/nix/src/libutil/util.hh') diff --git a/third_party/nix/src/libutil/util.hh b/third_party/nix/src/libutil/util.hh index b6d726b46c01..b3349c4f39c4 100644 --- a/third_party/nix/src/libutil/util.hh +++ b/third_party/nix/src/libutil/util.hh @@ -26,7 +26,7 @@ struct Source; extern const std::string nativeSystem; /* Return an environment variable. */ -std::string getEnv(const std::string& key, const std::string& def = ""); +std::optional getEnv(const std::string& key); /* Get the entire environment. */ std::map getEnv(); -- cgit 1.4.1