From 460c46a3a78d9956c04543333f6c8f01fa1b0a87 Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 7 Apr 2008 18:39:28 +0000 Subject: * load.c (rb_provided): check expanded path for relative path features, loading or loaded features are already expanded in 1.9. * variable.c (rb_autoload_load): no needs to check if provided before rb_require_safe. [ruby-dev:34266] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15920 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- load.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'load.c') diff --git a/load.c b/load.c index 1d1058961..a2ffce4e4 100644 --- a/load.c +++ b/load.c @@ -191,7 +191,13 @@ int rb_provided(const char *feature) { const char *ext = strrchr(feature, '.'); + volatile VALUE fullpath = 0; + if (*feature == '.' && + (feature[1] == '/' || strncmp(feature+1, "./", 2) == 0)) { + fullpath = rb_file_expand_path(rb_str_new2(feature), Qnil); + feature = RSTRING_PTR(fullpath); + } if (ext && !strchr(ext, '/')) { if (IS_RBEXT(ext)) { if (rb_feature_p(feature, ext, Qtrue, Qfalse, 0)) return Qtrue; -- cgit