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