summaryrefslogtreecommitdiffstats
path: root/load.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-04-07 18:39:28 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-04-07 18:39:28 +0000
commit460c46a3a78d9956c04543333f6c8f01fa1b0a87 (patch)
treeb96ae47f8fe939bb59cf6b3d9f89132ac9261934 /load.c
parentfb7b937f099bc47c457b5cc636ef709773c59694 (diff)
downloadruby-460c46a3a78d9956c04543333f6c8f01fa1b0a87.tar.gz
ruby-460c46a3a78d9956c04543333f6c8f01fa1b0a87.tar.xz
ruby-460c46a3a78d9956c04543333f6c8f01fa1b0a87.zip
* 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
Diffstat (limited to 'load.c')
-rw-r--r--load.c6
1 files changed, 6 insertions, 0 deletions
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;