summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Arko <andre@arko.net>2011-05-26 16:38:18 -0700
committerAndre Arko <andre@arko.net>2011-05-26 16:40:27 -0700
commitec85fd75796b25e6bb07777e7af330c117f9d9ae (patch)
tree1c6a0df91c39af3748bf82159b2d3b18e3dd1f65
parent3903dfd5038aefd078bca0cba3533b155b615591 (diff)
downloadbundler-ec85fd75796b25e6bb07777e7af330c117f9d9ae.tar.gz
escape filenames before putting them in regexes
closes #1206
-rw-r--r--lib/bundler/shared_helpers.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/bundler/shared_helpers.rb b/lib/bundler/shared_helpers.rb
index 10cb91237f..e6f4899f06 100644
--- a/lib/bundler/shared_helpers.rb
+++ b/lib/bundler/shared_helpers.rb
@@ -58,9 +58,9 @@ module Bundler
if defined?(::Gem)
me = File.expand_path("../../", __FILE__)
$LOAD_PATH.reject! do |p|
- next if File.expand_path(p) =~ /^#{me}/
+ next if File.expand_path(p) =~ /^#{Regexp.escape(me)}/
p != File.dirname(__FILE__) &&
- Bundler.rubygems.gem_path.any?{|gp| p =~ /^#{gp}/ }
+ Bundler.rubygems.gem_path.any?{|gp| p =~ /^#{Regexp.escape(gp)}/ }
end
$LOAD_PATH.uniq!
end