From a1cd868c0224f16d921a25f04cbc39cb03a5471d Mon Sep 17 00:00:00 2001 From: Phil Booth Date: Wed, 26 Sep 2018 06:49:21 +0100 Subject: Treat empty environment variables as unset --- src/env.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/env.rs b/src/env.rs index 51e91a9..d570932 100644 --- a/src/env.rs +++ b/src/env.rs @@ -74,6 +74,11 @@ impl Source for Environment { }; for (key, value) in env::vars() { + // Treat empty environment variables as unset + if cfg!(feature = "ignore-empty-env-vars") && value == "" { + continue; + } + let mut key = key.to_string(); // Check for prefix -- cgit v1.2.3