summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-07-24 09:02:49 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-07-24 09:02:49 +0000
commitf55d1dc3ef795dbd30a7b745d69a240f52040180 (patch)
treeb8381e364f137d224504f601fa9ff484ea4a88e8 /eval.c
parentb4d32332ecad5436c7bcccd946910896cf5851b7 (diff)
* eval.c (rb_provide_feature): should not tweak extension used for
loading. * eval.c (rb_f_require): should not include path in $" value * file.c (rb_find_file): should return 0 explicitly on failure. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_6@1641 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c32
1 files changed, 10 insertions, 22 deletions
diff --git a/eval.c b/eval.c
index d9963b44bf..17d48438cf 100644
--- a/eval.c
+++ b/eval.c
@@ -5312,19 +5312,6 @@ static void
rb_provide_feature(feature)
VALUE feature;
{
- char *ext;
- char *f = RSTRING(feature)->ptr;
-
- ext = strrchr(f, '.');
- if (ext && (strcmp(DLEXT, ext) == 0
-#ifdef DLEXT2
- || strcmp(DLEXT2, ext) == 0
-#endif
- )) {
- feature = rb_str_new(RSTRING(feature)->ptr, ext-RSTRING(feature)->ptr);
- rb_str_cat2(feature, ".so");
- }
- if (rb_feature_p(RSTRING(feature)->ptr, Qtrue)) return;
rb_ary_push(rb_features, feature);
}
@@ -5360,19 +5347,19 @@ rb_f_require(obj, fname)
}
else if (strcmp(".so", ext) == 0 || strcmp(".o", ext) == 0) {
fname = rb_str_new(RSTRING(fname)->ptr, ext-RSTRING(fname)->ptr);
- tmp = rb_str_dup(fname);
+ feature = tmp = rb_str_dup(fname);
rb_str_cat2(tmp, DLEXT);
tmp = rb_find_file(tmp);
if (tmp) {
- feature = fname = tmp;
+ fname = tmp;
goto load_dyna;
}
#ifdef DLEXT2
- tmp = rb_str_dup(fname);
+ feature = tmp = rb_str_dup(fname);
rb_str_cat2(tmp, DLEXT);
tmp = rb_find_file(tmp);
if (tmp) {
- feature = fname = tmp;
+ fname = tmp;
goto load_dyna;
}
#endif
@@ -5380,7 +5367,8 @@ rb_f_require(obj, fname)
else if (strcmp(DLEXT, ext) == 0) {
tmp = rb_find_file(fname);
if (tmp) {
- feature = fname = tmp;
+ feature = fname;
+ fname = tmp;
goto load_dyna;
}
}
@@ -5388,7 +5376,8 @@ rb_f_require(obj, fname)
else if (strcmp(DLEXT2, ext) == 0) {
tmp = rb_find_file(fname);
if (tmp) {
- feature = fname = tmp;
+ feature = fname;
+ fname = tmp;
goto load_dyna;
}
}
@@ -5400,12 +5389,11 @@ rb_f_require(obj, fname)
break;
case 1:
- feature = fname;
- fname = tmp;
+ feature = fname = tmp;
goto load_rb;
default:
- feature = fname;
+ feature = tmp;
fname = rb_find_file(tmp);
goto load_dyna;
}