summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authoreban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-05-29 02:10:22 +0000
committereban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-05-29 02:10:22 +0000
commit869b1efeb4eea77338863faff98da2432acb4b5d (patch)
tree25e0bc63e15ac1d40e231be94d343bf42dea3751 /eval.c
parentd7fe17edf08c1cee7f5b87251d2f09345900fcf9 (diff)
see ChangeLog.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@716 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/eval.c b/eval.c
index 8220274a04..9edf9aeb3e 100644
--- a/eval.c
+++ b/eval.c
@@ -4970,8 +4970,11 @@ rb_f_require(obj, fname)
strcpy(ext, DLEXT);
file = feature = buf;
}
+ file = rb_find_file(file);
+ if (file) goto load_dyna;
#ifdef DLEXT2
- else if (strcmp(ext, DLEXT2) != 0) {
+ file = feature = RSTRING(fname)->ptr;
+ if (strcmp(ext, DLEXT2) != 0) {
buf = ALLOCA_N(char, strlen(file)+sizeof(DLEXT2)+4);
strcpy(buf, feature);
ext = strrchr(buf, '.');
@@ -4980,15 +4983,22 @@ rb_f_require(obj, fname)
strcpy(ext, DLEXT2);
file = feature = buf;
}
-#endif
file = rb_find_file(file);
if (file) goto load_dyna;
+#endif
}
else if (strcmp(DLEXT, ext) == 0) {
feature = RSTRING(fname)->ptr;
file = rb_find_file(feature);
if (file) goto load_dyna;
}
+#ifdef DLEXT2
+ else if (strcmp(DLEXT2, ext) == 0) {
+ feature = RSTRING(fname)->ptr;
+ file = rb_find_file(feature);
+ if (file) goto load_dyna;
+ }
+#endif
}
buf = ALLOCA_N(char, strlen(RSTRING(fname)->ptr) + 5);
strcpy(buf, RSTRING(fname)->ptr);