summaryrefslogtreecommitdiff
path: root/ruby.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-03-30 09:11:29 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-03-30 09:11:29 +0000
commit84b5e3e0758c34eb4e303858f12ed8ae086db7d4 (patch)
tree0422c7b99cc03260ba607baade98aa7736d93ec0 /ruby.c
parent074db9c6fb49081369286ea5173985125e0107e9 (diff)
* version.c (ruby_initial_load_paths): moved initial load path
from ruby.c. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@27110 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ruby.c')
-rw-r--r--ruby.c34
1 files changed, 9 insertions, 25 deletions
diff --git a/ruby.c b/ruby.c
index 41143981c5..9483c6ae1e 100644
--- a/ruby.c
+++ b/ruby.c
@@ -252,6 +252,8 @@ ruby_incpush(path)
void
ruby_init_loadpath()
{
+ extern const struct ruby_initial_loadpath ruby_initial_load_paths;
+ const char *paths = (const char *)&ruby_initial_load_paths;
#if defined LOAD_RELATIVE
char libpath[FILENAME_MAX+1];
size_t baselen;
@@ -310,38 +312,20 @@ ruby_init_loadpath()
#define RUBY_RELATIVE(path) (path)
#define PREFIX_PATH() rubylib_mangled_path(exec_prefix, sizeof(exec_prefix)-1)
#endif
-#define incpush(path) rb_ary_push(rb_load_path, rubylib_mangled_path2(path))
+#define incpush(path, len) rb_ary_push(rb_load_path, rubylib_mangled_path(path, len))
if (rb_safe_level() == 0) {
ruby_incpush(getenv("RUBYLIB"));
}
-#ifdef RUBY_SEARCH_PATH
- incpush(RUBY_RELATIVE(RUBY_SEARCH_PATH));
-#endif
-
- incpush(RUBY_RELATIVE(RUBY_SITE_LIB2));
-#ifdef RUBY_SITE_THIN_ARCHLIB
- incpush(RUBY_RELATIVE(RUBY_SITE_THIN_ARCHLIB));
-#endif
- incpush(RUBY_RELATIVE(RUBY_SITE_ARCHLIB));
- incpush(RUBY_RELATIVE(RUBY_SITE_LIB));
-
- incpush(RUBY_RELATIVE(RUBY_VENDOR_LIB2));
-#ifdef RUBY_VENDOR_THIN_ARCHLIB
- incpush(RUBY_RELATIVE(RUBY_VENDOR_THIN_ARCHLIB));
-#endif
- incpush(RUBY_RELATIVE(RUBY_VENDOR_ARCHLIB));
- incpush(RUBY_RELATIVE(RUBY_VENDOR_LIB));
-
- incpush(RUBY_RELATIVE(RUBY_LIB));
-#ifdef RUBY_THIN_ARCHLIB
- incpush(RUBY_RELATIVE(RUBY_THIN_ARCHLIB));
-#endif
- incpush(RUBY_RELATIVE(RUBY_ARCHLIB));
+ while (*paths) {
+ size_t len = strlen(paths);
+ incpush(RUBY_RELATIVE(paths), len);
+ paths += len + 1;
+ }
if (rb_safe_level() == 0) {
- incpush(".");
+ incpush(".", 1);
}
rb_const_set(rb_cObject, rb_intern("TMP_RUBY_PREFIX"), rb_obj_freeze(PREFIX_PATH()));