various: proper escape in regex
This commit is contained in:
parent
48a1e1b47f
commit
91fb49d270
@ -142,7 +142,7 @@ class FormulaAuditor
|
||||
swig
|
||||
]
|
||||
|
||||
FILEUTILS_METHODS = FileUtils.singleton_methods(false).join "|"
|
||||
FILEUTILS_METHODS = FileUtils.singleton_methods(false).map { |m| Regexp.escape(m) }.join "|"
|
||||
|
||||
def initialize(formula, options = {})
|
||||
@formula = formula
|
||||
|
@ -238,7 +238,7 @@ module Homebrew
|
||||
|
||||
ignores = []
|
||||
if f.deps.any? { |dep| dep.name == "go" }
|
||||
ignores << %r{#{HOMEBREW_CELLAR}/go/[\d\.]+/libexec}
|
||||
ignores << %r{#{Regexp.escape(HOMEBREW_CELLAR)}/go/[\d\.]+/libexec}
|
||||
end
|
||||
|
||||
if ARGV.include? "--skip-relocation"
|
||||
|
@ -110,7 +110,7 @@ class FormulaCreator
|
||||
when %r{github\.com/\S+/(\S+)/archive/}
|
||||
@name = $1
|
||||
else
|
||||
/(.*?)[-_.]?#{path.version}/.match path.basename
|
||||
/(.*?)[-_.]?#{Regexp.escape(path.version)}/.match path.basename
|
||||
@name = $1
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user