summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2019-08-17 17:01:19 +0900
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2019-08-17 17:01:23 +0900
commit221ba9b66c022a99227de8bf21db618666e17c42 (patch)
tree6d537acd3c395860fc473ea14b66490bca0a587a
parentd041c6cebbe7fe973789616bef43200213e1a001 (diff)
Revert "`Gem.load_path_insert_index always returns non-nil index after Ruby 1.9"
This reverts commit 260ef51a73c067599826c8ab110c53994c1b6226. This broke the stable versions of Ruby like 2.4 and 2.5
-rwxr-xr-xlib/rubygems/core_ext/kernel_require.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/rubygems/core_ext/kernel_require.rb b/lib/rubygems/core_ext/kernel_require.rb
index b4aebf878c..5516933a5c 100755
--- a/lib/rubygems/core_ext/kernel_require.rb
+++ b/lib/rubygems/core_ext/kernel_require.rb
@@ -40,7 +40,7 @@ module Kernel
# https://github.com/rubygems/rubygems/pull/1868
resolved_path = begin
rp = nil
- $LOAD_PATH[0...Gem.load_path_insert_index].each do |lp|
+ $LOAD_PATH[0...Gem.load_path_insert_index || -1].each do |lp|
safe_lp = lp.dup.untaint
next if File.symlink? safe_lp # for backword compatibility
Gem.suffixes.each do |s|