summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-07-24 09:07:33 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-07-24 09:07:33 +0000
commit15ffbb1f820be7c798a7eb0aa2be11b5d4207460 (patch)
treef27d9d12e2cda0dca1435e1f0567d9fb423c7230 /eval.c
parent9e214f30c4f2bb6e6529c1bb988be1e46026919f (diff)
* eval.c (rb_provide_feature): should not tweak extension used for
loading. * io.c (io_fread): use fread(3) if PENDING_COUND is available. * class.c (rb_mod_include_p): Module#include? added. [new] * re.c (ignorecase_setter): give warning on modifying $=. * string.c (rb_str_casecmp): new method. [new] * string.c (rb_str_eql): separated from rb_str_equal(), make it always be case sensitive. [new] * string.c (rb_str_hash): made it always be case sensitive. * 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/trunk@1642 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c35
1 files changed, 11 insertions, 24 deletions
diff --git a/eval.c b/eval.c
index 95cf12d18a..1e0339b8c2 100644
--- a/eval.c
+++ b/eval.c
@@ -5392,19 +5392,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);
}
@@ -5440,19 +5427,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
@@ -5460,7 +5447,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;
}
}
@@ -5468,7 +5456,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;
}
}
@@ -5480,17 +5469,15 @@ 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;
}
- rb_raise(rb_eLoadError, "No such file to load -- %s",
- RSTRING(fname)->ptr);
+ rb_raise(rb_eLoadError, "No such file to load -- %s", RSTRING(fname)->ptr);
load_dyna:
rb_provide_feature(feature);