Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Compact whitespace when removing flags

This prevents multiple calls to flag-modifying ENV methods from
resulting in large amounts of consecutive spaces.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
  • Loading branch information...
commit 84a084a0830cd16e43fdfce079eb4fa96843ea40 1 parent 672696b
@jacknagel jacknagel authored
Showing with 1 addition and 0 deletions.
  1. +1 −0  Library/Homebrew/extend/ENV.rb
View
1  Library/Homebrew/extend/ENV.rb
@@ -409,6 +409,7 @@ def remove key, value
[*key].each do |key|
next if self[key].nil?
self[key] = self[key].sub value, '' # can't use sub! on ENV
+ self[key] = self[key].gsub /\s+/, ' ' # compact whitespace
self[key] = nil if self[key].empty? # keep things clean
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.