summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPhil Booth <pmbooth@gmail.com>2018-09-26 06:49:21 +0100
committerPhil Booth <pmbooth@gmail.com>2018-09-26 07:02:39 +0100
commita1cd868c0224f16d921a25f04cbc39cb03a5471d (patch)
tree41159d19af67c8bacc1917b0ddac193a8e6bf416 /src
parent4475925dc2136ae139245164cbb77d59b3d84dae (diff)
Treat empty environment variables as unset
Diffstat (limited to 'src')
-rw-r--r--src/env.rs5
1 files changed, 5 insertions, 0 deletions
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