* 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
This commit is contained in:
nobu 2003-01-14 12:56:34 +00:00
Родитель 6e1f15fc8b
Коммит 17bb511df2
2 изменённых файлов: 13 добавлений и 3 удалений

Просмотреть файл

@ -1,3 +1,9 @@
Tue Jan 14 21:47:56 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net>
* 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
Tue Jan 14 01:21:32 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net>
* io.c (next_argv): not always set binmode.

10
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: