aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd/create.rb
diff options
context:
space:
mode:
authorXu Cheng2016-07-13 15:58:04 +0800
committerXu Cheng2016-07-13 19:11:46 +0800
commit91fb49d270f0837e851b3e6e6b0f53848f024f6c (patch)
tree8d2b1b4d03c0c1cf314d839d4d088eb688e4dda9 /Library/Homebrew/cmd/create.rb
parent48a1e1b47fecdde0127274a55e85312dbf268164 (diff)
downloadbrew-91fb49d270f0837e851b3e6e6b0f53848f024f6c.tar.bz2
various: proper escape in regex
Diffstat (limited to 'Library/Homebrew/cmd/create.rb')
-rw-r--r--Library/Homebrew/cmd/create.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/Library/Homebrew/cmd/create.rb b/Library/Homebrew/cmd/create.rb
index a7aa78e49..eb3bec46f 100644
--- a/Library/Homebrew/cmd/create.rb
+++ b/Library/Homebrew/cmd/create.rb
@@ -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