summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/eval.c b/eval.c
index 5522cb4d65..5b0dfb5f14 100644
--- a/eval.c
+++ b/eval.c
@@ -5621,18 +5621,18 @@ rb_f_require(obj, fname)
fname = tmp;
goto load_rb;
}
+ goto not_found;
}
else if (strcmp(".so", ext) == 0 || strcmp(".o", ext) == 0) {
- fname = rb_str_new(RSTRING(fname)->ptr, ext-RSTRING(fname)->ptr);
+ tmp = rb_str_new(RSTRING(fname)->ptr, ext-RSTRING(fname)->ptr);
#ifdef DLEXT2
- tmp = fname;
if (rb_find_file_ext(&tmp, loadable_ext+1)) {
feature = tmp;
fname = rb_find_file(tmp);
goto load_dyna;
}
#else
- feature = tmp = rb_str_dup(fname);
+ feature = tmp;
rb_str_cat2(tmp, DLEXT);
tmp = rb_find_file(tmp);
if (tmp) {
@@ -5640,6 +5640,7 @@ rb_f_require(obj, fname)
goto load_dyna;
}
#endif
+ goto not_found;
}
else if (strcmp(DLEXT, ext) == 0) {
tmp = rb_find_file(fname);
@@ -5648,6 +5649,7 @@ rb_f_require(obj, fname)
fname = tmp;
goto load_dyna;
}
+ goto not_found;
}
#ifdef DLEXT2
else if (strcmp(DLEXT2, ext) == 0) {
@@ -5657,6 +5659,7 @@ rb_f_require(obj, fname)
fname = tmp;
goto load_dyna;
}
+ goto not_found;
}
#endif
}
@@ -5676,6 +5679,7 @@ rb_f_require(obj, fname)
}
if (rb_feature_p(RSTRING(fname)->ptr, Qfalse))
return Qfalse;
+ not_found:
rb_raise(rb_eLoadError, "No such file to load -- %s", RSTRING(fname)->ptr);
load_dyna: