mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* eval.c (search_required): search actual file name once when no
extension specified. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5288 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
cecdab3bf0
commit
daef2a1df2
2 changed files with 14 additions and 10 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Thu Dec 25 05:08:09 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* eval.c (search_required): search actual file name once when no
|
||||||
|
extension specified.
|
||||||
|
|
||||||
Thu Dec 25 04:00:44 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
|
Thu Dec 25 04:00:44 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
* stable version 1.8.1 released.
|
* stable version 1.8.1 released.
|
||||||
|
|
19
eval.c
19
eval.c
|
@ -6084,6 +6084,7 @@ search_required(fname, featurep, path)
|
||||||
{
|
{
|
||||||
VALUE tmp;
|
VALUE tmp;
|
||||||
char *ext, *ftptr;
|
char *ext, *ftptr;
|
||||||
|
int type;
|
||||||
|
|
||||||
*featurep = fname;
|
*featurep = fname;
|
||||||
*path = 0;
|
*path = 0;
|
||||||
|
@ -6116,24 +6117,22 @@ search_required(fname, featurep, path)
|
||||||
if (*path = rb_find_file(fname)) return 's';
|
if (*path = rb_find_file(fname)) return 's';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((ext = rb_feature_p(ftptr, 0, Qfalse)) != 0) {
|
|
||||||
return strcmp(ext, ".rb") == 0 ? 'r' : 's';
|
|
||||||
}
|
|
||||||
tmp = fname;
|
tmp = fname;
|
||||||
switch (rb_find_file_ext(&tmp, loadable_ext)) {
|
switch (type = rb_find_file_ext(&tmp, loadable_ext)) {
|
||||||
case 0:
|
case 0:
|
||||||
|
if ((ext = rb_feature_p(ftptr, 0, Qfalse))) {
|
||||||
|
type = strcmp(".rb", ext);
|
||||||
|
break;
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
case 1:
|
|
||||||
*featurep = tmp;
|
|
||||||
*path = rb_find_file(tmp);
|
|
||||||
return 'r';
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
*featurep = tmp;
|
*featurep = tmp;
|
||||||
|
ext = strrchr(ftptr = RSTRING(tmp)->ptr, '.');
|
||||||
|
if (rb_feature_p(ftptr, ext, !--type)) break;
|
||||||
*path = rb_find_file(tmp);
|
*path = rb_find_file(tmp);
|
||||||
return 's';
|
|
||||||
}
|
}
|
||||||
|
return type ? 's' : 'r';
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue