summaryrefslogtreecommitdiff
path: root/load.c
diff options
context:
space:
mode:
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 1d10589611..a2ffce4e4b 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;