aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike McQuaid2017-11-27 14:43:24 +0000
committerMike McQuaid2017-11-27 14:43:24 +0000
commitcd7049bb72faaae6bebe0739b5ffef0eed5e6648 (patch)
tree4ca516c1d5743d84562dd3c7c34fbe3a596ef462
parentf262cbc53126078e527b9ab6c250f3054dc892df (diff)
downloadbrew-cd7049bb72faaae6bebe0739b5ffef0eed5e6648.tar.bz2
bin/brew: don't set empty, unfiltered variables.
Otherwise we unconditionally set e.g. `CI`, `TRAVIS`.
-rwxr-xr-xbin/brew3
1 files changed, 3 insertions, 0 deletions
diff --git a/bin/brew b/bin/brew
index 4ac9473a7..7d36ff92d 100755
--- a/bin/brew
+++ b/bin/brew
@@ -91,6 +91,9 @@ then
for VAR in HOME SHELL PATH TERM LOGNAME USER CI TRAVIS \
"${!HOMEBREW_@}" "${!TRAVIS_@}"
do
+ # Skip if variable value is empty.
+ [[ -z "${!VAR}" ]] && continue
+
FILTERED_ENV+=( "${VAR}=${!VAR}" )
done