aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike McQuaid2016-11-03 17:35:12 -0400
committerGitHub2016-11-03 17:35:12 -0400
commit0028cf9fb85e7fecb4ad803a817600068c821dc9 (patch)
tree843c8fdcbd61f4c9fa30d87f01018e45f43c36aa
parent09f438aeccab6b0aba40b14763b9ba7be7917836 (diff)
parentbfa19b338518f50ec7e5c2d2ed4919fa50217dee (diff)
downloadbrew-0028cf9fb85e7fecb4ad803a817600068c821dc9.tar.bz2
Merge pull request #1433 from bfontaine/audit-escape
audit: Escape interpolated string in regexp
-rw-r--r--Library/Homebrew/dev-cmd/audit.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb
index 3c1901763..568051b43 100644
--- a/Library/Homebrew/dev-cmd/audit.rb
+++ b/Library/Homebrew/dev-cmd/audit.rb
@@ -741,7 +741,7 @@ class FormulaAuditor
end
bin_names.each do |name|
["system", "shell_output", "pipe_output"].each do |cmd|
- if text =~ /(def test|test do).*#{cmd}[\(\s]+['"]#{name}[\s'"]/m
+ if text =~ /(def test|test do).*#{cmd}[\(\s]+['"]#{Regexp.escape name}[\s'"]/m
problem %(fully scope test #{cmd} calls e.g. #{cmd} "\#{bin}/#{name}")
end
end