aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd
diff options
context:
space:
mode:
authorJack Nagel2013-07-22 22:53:43 -0500
committerJack Nagel2013-07-22 22:53:43 -0500
commit49e8f9b5ff1a0fe6513715d98e22c0227d09339e (patch)
treeddc44998b3b1dc3701ffbc3d17ec2238e9df4c02 /Library/Homebrew/cmd
parent65786d6ebe2559739429939c575dc76bd4f00fab (diff)
downloadhomebrew-49e8f9b5ff1a0fe6513715d98e22c0227d09339e.tar.bz2
audit: escape dep before regexp interpolation
Diffstat (limited to 'Library/Homebrew/cmd')
-rw-r--r--Library/Homebrew/cmd/audit.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/Library/Homebrew/cmd/audit.rb b/Library/Homebrew/cmd/audit.rb
index 3d2321256..a49d01e06 100644
--- a/Library/Homebrew/cmd/audit.rb
+++ b/Library/Homebrew/cmd/audit.rb
@@ -511,6 +511,7 @@ class FormulaAuditor
end
def audit_conditional_dep(dep, condition, line)
+ dep = Regexp.escape(dep)
case condition
when /if build\.include\? ['"]with-#{dep}['"]$/, /if build\.with\? ['"]#{dep}['"]$/
problem %{Replace #{line.inspect} with "depends_on #{quote_dep(dep)} => :optional"}