From 0ad5a9cb07a670d84c58bac2f2af3dbd5c039ee3 Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 30 Apr 2008 09:03:03 +0000 Subject: * load.c (rb_load_path), vm_core.h (rb_vm_t): moved to VM. * load.c (rb_get_load_path): returns absolute load path. * load.c (load_path_getter): $LOAD_PATH getter. * file.c (rb_find_file_ext, rb_find_file), ruby.c (push_include, ruby_init_loadpath): use the accessor. * vm.c (rb_vm_mark): mark load_path. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16240 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- file.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'file.c') diff --git a/file.c b/file.c index 88893e7d9..4c51c171e 100644 --- a/file.c +++ b/file.c @@ -4292,14 +4292,14 @@ file_load_ok(const char *path) return eaccess(path, R_OK) == 0; } -extern VALUE rb_load_path; +VALUE rb_get_load_path(void); int rb_find_file_ext(VALUE *filep, const char *const *ext) { char *path, *found; char *f = RSTRING_PTR(*filep); - VALUE fname; + VALUE fname, load_path; long i, j; if (f[0] == '~') { @@ -4325,15 +4325,15 @@ rb_find_file_ext(VALUE *filep, const char *const *ext) return 0; } - if (!rb_load_path) return 0; + load_path = rb_get_load_path(); + if (!load_path) return 0; - Check_Type(rb_load_path, T_ARRAY); for (j=0; ext[j]; j++) { fname = rb_str_dup(*filep); rb_str_cat2(fname, ext[j]); OBJ_FREEZE(fname); - for (i=0;i 0) { rb_ary_push(tmp, str); -- cgit