aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2013-12-27 13:01:41 -0600
committerJack Nagel2013-12-27 13:01:41 -0600
commitccc0eb98ba2327c0a5f8b76b976538748d92dcc0 (patch)
tree8a257c7251a718108d525b25de8994d89ac01e0d /Library
parentb50d5126eee403ca74cb01667be0b7f74f508cf3 (diff)
downloadbrew-ccc0eb98ba2327c0a5f8b76b976538748d92dcc0.tar.bz2
Escape prefix when interpolating into regexp
Diffstat (limited to 'Library')
-rwxr-xr-xLibrary/ENV/4.3/cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/Library/ENV/4.3/cc b/Library/ENV/4.3/cc
index ba9d69285..6a9407d03 100755
--- a/Library/ENV/4.3/cc
+++ b/Library/ENV/4.3/cc
@@ -137,7 +137,7 @@ class Cmd
when /^-L(.+)?/
path = $1.chuzzle || whittler.next
doit = case path.cleanpath
- when %r{^#{brewfix}}
+ when %r{^#{Regexp.escape(brewfix)}}
# maybe homebrew is installed to /sw or /opt/brew
true
when %r{^/opt}, %r{^/sw}, %r{/usr/X11}
@@ -201,7 +201,7 @@ class Cmd
end
def cpath
cpath = ENV['CMAKE_PREFIX_PATH'].split(':').map{|d| "#{d}/include" } + ENV['CMAKE_INCLUDE_PATH'].split(':')
- opt = cpath.grep(%r{^#{brewfix}/opt})
+ opt = cpath.grep(%r{^#{Regexp.escape(brewfix)}/opt})
sys = cpath - opt
[sys, opt]
end