load.c: real path to load

* load.c (rb_construct_expanded_load_path): expand load paths to
  real paths to get rid of duplicate loading from symbolic-linked
  directories.  [Feature #10222]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59984 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2017-09-21 07:29:20 +00:00
parent 5754f15975
commit b6d3927e16
3 changed files with 17 additions and 2 deletions

View file

@ -1019,7 +1019,7 @@ $stderr = $stdout; raise "\x82\xa0"') do |outs, errs, status|
warning = nil
path = nil
Tempfile.create(%w[circular .rb]) do |t|
path = t.path
path = File.realpath(t.path)
basename = File.basename(path)
t.puts "require '#{basename}'"
t.close