diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-03-12 15:11:10 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-03-12 15:11:10 +0000 |
commit | 04e68d0107460575a86cc427338eae436be16286 (patch) | |
tree | 21d6239b192f81e58fdfd09959e613dffd79ce9a /ruby.c | |
parent | 614619031b6d34d12f7bf2752c24eadefb9a8f8f (diff) | |
download | ruby-04e68d0107460575a86cc427338eae436be16286.tar.gz |
* 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.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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; } |