diff options
| author | ilovezfs | 2018-01-24 07:00:41 -0800 | 
|---|---|---|
| committer | ilovezfs | 2018-01-28 08:12:12 -0800 | 
| commit | 98e48a9da7b0f1444d95f942fb3c1804cbc80991 (patch) | |
| tree | 30e71d38face0ff2306b31686e2efde0eb996987 /Library/Homebrew/dev-cmd | |
| parent | edd1c76d409e224e329131bbd635d944cdf6fe1f (diff) | |
| download | brew-98e48a9da7b0f1444d95f942fb3c1804cbc80991.tar.bz2 | |
bump-formula-pr: regex escape urls in replacements.
Diffstat (limited to 'Library/Homebrew/dev-cmd')
| -rw-r--r-- | Library/Homebrew/dev-cmd/bump-formula-pr.rb | 6 | 
1 files changed, 3 insertions, 3 deletions
| diff --git a/Library/Homebrew/dev-cmd/bump-formula-pr.rb b/Library/Homebrew/dev-cmd/bump-formula-pr.rb index 1f60412ed..ca3f4cfe8 100644 --- a/Library/Homebrew/dev-cmd/bump-formula-pr.rb +++ b/Library/Homebrew/dev-cmd/bump-formula-pr.rb @@ -232,12 +232,12 @@ module Homebrew      end      replacement_pairs += formula_spec.mirrors.map do |mirror| -      [/ +mirror \"#{mirror}\"\n/m, ""] +      [/ +mirror \"#{Regexp.escape(mirror)}\"\n/m, ""]      end      replacement_pairs += if new_url_hash        [ -        [formula_spec.url, new_url], +        [/#{Regexp.escape(formula_spec.url)}/, new_url],          [old_hash, new_hash],        ]      else @@ -250,7 +250,7 @@ module Homebrew      backup_file = File.read(formula.path) unless ARGV.dry_run?      if new_mirror -      replacement_pairs << [/^( +)(url \"#{new_url}\"\n)/m, "\\1\\2\\1mirror \"#{new_mirror}\"\n"] +      replacement_pairs << [/^( +)(url \"#{Regexp.escape(new_url)}\"\n)/m, "\\1\\2\\1mirror \"#{new_mirror}\"\n"]      end      if forced_version && forced_version != "0" | 
