audit: escape dep before regexp interpolation

This commit is contained in:
Jack Nagel 2013-07-22 22:53:43 -05:00
parent 3afa9c2ceb
commit a3863394c0

View File

@ -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"}