mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
0c8bc11d3d
commit
37504dc560
5 changed files with 45 additions and 6 deletions
6
load.c
6
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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue