diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-01-14 12:56:34 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-01-14 12:56:34 +0000 |
commit | 17bb511df2d33f4c344d7aefc2f5dfcd53fdaaf7 (patch) | |
tree | 579bd527f57d8560b348d5cd57f5bc5eb670acbe /eval.c | |
parent | 6e1f15fc8b7e62360d32bc6ca47b1309d25b7766 (diff) |
* eval.c (rb_f_require): do not search adding .rb/.so suffixes if
the suffix specifiched. [ruby-dev:18702]
http://moonrock.jp/~don/d/200211.html#d08_t1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3341 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -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: |