aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2013-07-22 22:53:43 -0500
committerJack Nagel2013-07-22 22:53:43 -0500
commita3863394c0cbf38255d9b71cb589710729bbbcc6 (patch)
treefe050c5e2038a48d868e2c97f3cc0eb67b08dd7d /Library
parent3afa9c2ceb26961e67333150e73b75eaa96050d5 (diff)
downloadbrew-a3863394c0cbf38255d9b71cb589710729bbbcc6.tar.bz2
audit: escape dep before regexp interpolation
Diffstat (limited to 'Library')
-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"}