summaryrefslogtreecommitdiff
path: root/load.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-03-30 09:26:09 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-03-30 09:26:09 +0000
commit38af94c6abaaa20aeaa1ffafbe3f6ff962f63eaa (patch)
treeee5ca5d6f52312d1d6fd79c8e1f01ad3014ca45d /load.c
parent635bdf6f13712b7bb536a469734a5b4446e1923e (diff)
* file.c (rb_file_dirname): split from rb_file_s_dirname.
* load.c (rb_f_require_relative): use absolute path instead of expanded path. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27111 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'load.c')
-rw-r--r--load.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/load.c b/load.c
index 2c391a1b86..8742d28b2e 100644
--- a/load.c
+++ b/load.c
@@ -452,13 +452,12 @@ VALUE
rb_f_require_relative(VALUE obj, VALUE fname)
{
VALUE rb_current_realfilepath(void);
- VALUE rb_file_s_dirname(VALUE klass, VALUE fname);
VALUE base = rb_current_realfilepath();
if (NIL_P(base)) {
rb_raise(rb_eLoadError, "cannot infer basepath");
}
- base = rb_file_s_dirname(rb_cFile, base);
- return rb_require_safe(rb_file_expand_path(fname, base), rb_safe_level());
+ base = rb_file_dirname(base);
+ return rb_require_safe(rb_file_absolute_path(fname, base), rb_safe_level());
}
static int