diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-04-07 18:39:28 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-04-07 18:39:28 +0000 |
commit | 37504dc560792ccd3e32d637d2fcaf5f0ac0a1ca (patch) | |
tree | b96ae47f8fe939bb59cf6b3d9f89132ac9261934 /load.c | |
parent | 0c8bc11d3d21611e996f3ed11493e984c22a3f18 (diff) |
* 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: svn+ssh://ci.ruby-lang.org/ruby/trunk@15920 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'load.c')
-rw-r--r-- | load.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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; |