aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2015-02-07 13:20:10 -0500
committerJack Nagel2015-02-07 13:54:33 -0500
commit357d0f279614c1c18f709f2dd4e310ad388d3915 (patch)
tree326283d86048accfa2dcc5e18de05643a9a6e200 /Library
parentf438af9915b1103dd241d5cf84327a7d7681b4eb (diff)
downloadbrew-357d0f279614c1c18f709f2dd4e310ad388d3915.tar.bz2
Use start_with? to simplify path sanity check
Diffstat (limited to 'Library')
-rwxr-xr-xLibrary/ENV/4.3/cc10
1 files changed, 1 insertions, 9 deletions
diff --git a/Library/ENV/4.3/cc b/Library/ENV/4.3/cc
index 4ab9dc671..65a95d373 100755
--- a/Library/ENV/4.3/cc
+++ b/Library/ENV/4.3/cc
@@ -199,15 +199,7 @@ class Cmd
end
def keep? path
- case path
- when %r{^#{Regexp.escape(prefix)}}o, %r{^#{Regexp.escape(cellar)}}o, %r{^#{Regexp.escape(tmpdir)}}o
- # maybe homebrew is installed to /sw or /opt/brew
- true
- when %r{^/opt}, %r{^/sw}, %r{/usr/X11}
- false
- else
- true
- end
+ path.start_with?(prefix, cellar, tmpdir) || !path.start_with?("/opt", "/sw", "/usr/X11")
end
def cflags