summaryrefslogtreecommitdiff
path: root/ruby.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-03-12 15:11:10 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-03-12 15:11:10 +0000
commit04e68d0107460575a86cc427338eae436be16286 (patch)
tree21d6239b192f81e58fdfd09959e613dffd79ce9a /ruby.c
parent614619031b6d34d12f7bf2752c24eadefb9a8f8f (diff)
* ruby.c (ruby_init_loadpath_safe): mark initial load paths.
* gem_prelude.rb (push_all_highest_version_gems_on_load_path): search insertion position by initial load path mark. * lib/rubygems.rb (Gem.load_path_insert_index): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26895 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ruby.c')
-rw-r--r--ruby.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/ruby.c b/ruby.c
index fdca44593d..bf0f83d67c 100644
--- a/ruby.c
+++ b/ruby.c
@@ -339,6 +339,7 @@ void
ruby_init_loadpath_safe(int safe_level)
{
VALUE load_path;
+ ID id_initial_load_path_mark;
extern const char ruby_initial_load_paths[];
const char *paths = ruby_initial_load_paths;
#if defined LOAD_RELATIVE
@@ -432,16 +433,18 @@ ruby_init_loadpath_safe(int safe_level)
#define RUBY_RELATIVE(path, len) rubylib_mangled_path(path, len)
#define PREFIX_PATH() rubylib_mangled_path(RUBY_LIB_PREFIX, sizeof(RUBY_LIB_PREFIX)-1)
#endif
-#define incpush(path) rb_ary_push(load_path, (path))
load_path = GET_VM()->load_path;
if (safe_level == 0) {
ruby_push_include(getenv("RUBYLIB"), identical_path);
}
+ id_initial_load_path_mark = rb_intern_const("@gem_prelude_index");
while (*paths) {
size_t len = strlen(paths);
- incpush(RUBY_RELATIVE(paths, len));
+ VALUE path = RUBY_RELATIVE(paths, len);
+ rb_ivar_set(path, id_initial_load_path_mark, path);
+ rb_ary_push(load_path, path);
paths += len + 1;
}