aboutsummaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authoreregon2011-03-20 22:37:25 +0100
committerAdam Vandenberg2011-03-20 19:12:29 -0700
commiteb121eeabb78e190b29c5d15da37b157e4e805f6 (patch)
tree1bc4fe7186bcf5a38fffdd915449c2ea5fc8bb2a /bin
parentaa6d7fce29f3fedd7d38c48dfb1171f7fc944838 (diff)
downloadhomebrew-eb121eeabb78e190b29c5d15da37b157e4e805f6.tar.bz2
use Module#const_get instead of eval
* may be a problem if the constant is scoped (like A::B), but this is not the case (const.split('::').inject(Object) { |c, part| c.const_get part } would solve that) * this was noticed in a comment of 9afc85ad but it has disappeared Signed-off-by: Adam Vandenberg <flangy@gmail.com>
Diffstat (limited to 'bin')
-rwxr-xr-xbin/brew3
1 files changed, 1 insertions, 2 deletions
diff --git a/bin/brew b/bin/brew
index c06a673dc..5fe19cc89 100755
--- a/bin/brew
+++ b/bin/brew
@@ -71,10 +71,9 @@ begin
# Add example external commands to PATH before checking.
ENV['PATH'] += ":#{HOMEBREW_REPOSITORY}/Library/Contributions/examples"
-
if system "/usr/bin/which -s brew-#{cmd}"
%w[CACHE CELLAR LIBRARY_PATH PREFIX REPOSITORY].each do |e|
- ENV["HOMEBREW_#{e}"] = eval "HOMEBREW_#{e}"
+ ENV["HOMEBREW_#{e}"] = Object.const_get "HOMEBREW_#{e}"
end
exec "brew-#{cmd}", *ARGV
elsif require? `/usr/bin/which brew-#{cmd}.rb`