diff options
author | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-02-16 16:25:40 +0000 |
---|---|---|
committer | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-02-16 16:25:40 +0000 |
commit | eaba9da1d13fac380fe94f977d7f8d89bd40cde0 (patch) | |
tree | b17e09f3ce10f925571e406c0deed966270c7804 /load.c | |
parent | 99c76a47ef8c65a27ee6d9a7dab03671dc22647a (diff) |
merge revision(s) 59983,59984: [Backport #10222] [Backport #14372] [Backport #14424]
file.c: rb_check_realpath
* file.c (rb_check_realpath): returns real path which has no
symbolic links. similar to rb_realpath except for returning
Qnil if any parts did not exist.
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/branches/ruby_2_4@62440 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'load.c')
-rw-r--r-- | load.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -85,7 +85,8 @@ rb_construct_expanded_load_path(enum expand_type type, int *has_relative, int *h if (is_string) rb_str_freeze(path); as_str = rb_get_path_check_convert(path, as_str, level); - expanded_path = rb_file_expand_path_fast(as_str, Qnil); + expanded_path = rb_check_realpath(Qnil, as_str); + if (NIL_P(expanded_path)) expanded_path = as_str; rb_str_freeze(expanded_path); rb_ary_push(ary, rb_fstring(expanded_path)); } |