aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/tap_constants.rb
diff options
context:
space:
mode:
authorJack Nagel2014-07-06 11:24:24 -0500
committerJack Nagel2014-07-06 11:25:56 -0500
commitf8fb74ff76f4f6b779bcaccee94bdb442f2ea51a (patch)
treef9bd9c443bde2055734bc4132e48031d3fc601c5 /Library/Homebrew/tap_constants.rb
parent7e268670ed4e2dec9a83cb8a79295135fb1c2110 (diff)
downloadbrew-f8fb74ff76f4f6b779bcaccee94bdb442f2ea51a.tar.bz2
Escape paths in regexps
Diffstat (limited to 'Library/Homebrew/tap_constants.rb')
-rw-r--r--Library/Homebrew/tap_constants.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/Library/Homebrew/tap_constants.rb b/Library/Homebrew/tap_constants.rb
index d706d8529..3550a0637 100644
--- a/Library/Homebrew/tap_constants.rb
+++ b/Library/Homebrew/tap_constants.rb
@@ -3,6 +3,6 @@ HOMEBREW_TAP_ARGS_REGEX = %r{^([\w-]+)/(homebrew-)?([\w-]+)$}
# match taps' formula, e.g. someuser/sometap/someformula
HOMEBREW_TAP_FORMULA_REGEX = %r{^([\w-]+)/([\w-]+)/([\w+-]+)$}
# match taps' directory path, e.g. HOMEBREW_LIBRARY/Taps/someuser/sometap
-HOMEBREW_TAP_DIR_REGEX = %r{#{HOMEBREW_LIBRARY}/Taps/([\w-]+)/([\w-]+)}
+HOMEBREW_TAP_DIR_REGEX = %r{#{Regexp.escape(HOMEBREW_LIBRARY.to_s)}/Taps/([\w-]+)/([\w-]+)}
# match taps' formula path, e.g. HOMEBREW_LIBRARY/Taps/someuser/sometap/someformula
HOMEBREW_TAP_PATH_REGEX = Regexp.new(HOMEBREW_TAP_DIR_REGEX.source + %r{/(.*)}.source)