aboutsummaryrefslogtreecommitdiffstats
path: root/load.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-09-21 07:29:20 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-09-21 07:29:20 +0000
commitdb73f13e10e0f2d0da1f8e18f2739c586156575f (patch)
treed26aaf1f7a35f7714142c027e24711f5696ae89d /load.c
parent93001aebd311ad8ec07e1a219bd153540c6429e0 (diff)
downloadruby-db73f13e10e0f2d0da1f8e18f2739c586156575f.tar.gz
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
Diffstat (limited to 'load.c')
-rw-r--r--load.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/load.c b/load.c
index 1b9dd48150..1d3ff23d55 100644
--- a/load.c
+++ b/load.c
@@ -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_ary_push(ary, rb_fstring(expanded_path));
}
rb_obj_freeze(ary);