diff options
| author | Jack Nagel | 2013-08-19 12:32:58 -0500 |
|---|---|---|
| committer | Jack Nagel | 2013-08-19 12:32:58 -0500 |
| commit | 061f8cb35f8ac155e16943951ae39aa75cbd24d2 (patch) | |
| tree | c7277a72e4cc8c158198964d261b95794bf0fca3 /Library/Homebrew/requirements/python_dependency.rb | |
| parent | 9699c0764efddbc7f9f398ed0fd1726db28523b3 (diff) | |
| download | brew-061f8cb35f8ac155e16943951ae39aa75cbd24d2.tar.bz2 | |
Fix superenv ENV[] hack
We override ENV[] to always return strings under superenv, because
legacy formulae assume that CFLAGS, etc. are non-nil.
However, the current implementation has a bug. If I simply concatenate
ENV['CFLAGS'] with another string, it mutates ENV['CFLAGS']:
irb> ENV['CFLAGS']
=> ""
irb> ENV['CFLAGS'] + 'a'
=> "a"
irb> ENV['CFLAGS']
=> "a"
Instead, let's simply return an empty string if the key doesn't exist.
This is sufficient because the following are equivalent:
1. ENV['CFLAGS'] += "string"
2. ENV['CFLAGS'] = ENV['CFLAGS'] + "string"
Diffstat (limited to 'Library/Homebrew/requirements/python_dependency.rb')
0 files changed, 0 insertions, 0 deletions
