mirror of
https://github.com/ruby/ruby.git
synced 2025-09-19 10:33:58 +02:00
* eval.c (rb_provided): return true only for features loaded from
.rb files, and not search actual library type. [ruby-dev:30414] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11945 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
e87f0fc477
commit
d8ecc168f1
3 changed files with 25 additions and 14 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Thu Mar 1 00:09:39 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* eval.c (rb_provided): return true only for features loaded from
|
||||||
|
.rb files, and not search actual library type. [ruby-dev:30414]
|
||||||
|
|
||||||
Wed Feb 28 21:15:00 2007 WATANABE Hirofumi <eban@ruby-lang.org>
|
Wed Feb 28 21:15:00 2007 WATANABE Hirofumi <eban@ruby-lang.org>
|
||||||
|
|
||||||
* configure.in (ac_cv_func_fcntl): fcntl support for MinGW.
|
* configure.in (ac_cv_func_fcntl): fcntl support for MinGW.
|
||||||
|
|
26
eval.c
26
eval.c
|
@ -6937,6 +6937,9 @@ static const char *const loadable_ext[] = {
|
||||||
0
|
0
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static int rb_feature_p _((const char *, const char *, int));
|
||||||
|
static int search_required _((VALUE, VALUE *, VALUE *));
|
||||||
|
|
||||||
static int
|
static int
|
||||||
rb_feature_p(feature, ext, rb)
|
rb_feature_p(feature, ext, rb)
|
||||||
const char *feature, *ext;
|
const char *feature, *ext;
|
||||||
|
@ -6973,7 +6976,7 @@ rb_feature_p(feature, ext, rb)
|
||||||
}
|
}
|
||||||
if (loading_tbl) {
|
if (loading_tbl) {
|
||||||
if (st_lookup(loading_tbl, (st_data_t)feature, 0)) {
|
if (st_lookup(loading_tbl, (st_data_t)feature, 0)) {
|
||||||
if (ext) return 'u';
|
if (!ext) return 'u';
|
||||||
return strcmp(ext, ".rb") ? 's' : 'r';
|
return strcmp(ext, ".rb") ? 's' : 'r';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -6993,21 +6996,24 @@ rb_feature_p(feature, ext, rb)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int search_required(VALUE, VALUE *, VALUE *);
|
|
||||||
|
|
||||||
int
|
int
|
||||||
rb_provided(feature)
|
rb_provided(feature)
|
||||||
const char *feature;
|
const char *feature;
|
||||||
{
|
{
|
||||||
VALUE fname, path;
|
const char *ext = strrchr(feature, '.');
|
||||||
|
|
||||||
if (rb_feature_p(feature, 0, Qfalse))
|
if (ext && !strchr(ext, '/')) {
|
||||||
return Qtrue;
|
if (strcmp(".rb", ext) == 0) {
|
||||||
if (search_required(rb_str_new2(feature), &fname, &path) != 0) {
|
if (rb_feature_p(feature, ext, Qtrue)) return Qtrue;
|
||||||
feature = RSTRING_PTR(fname);
|
return Qfalse;
|
||||||
if (rb_feature_p(feature, strrchr(feature, '.'), Qfalse))
|
|
||||||
return Qtrue;
|
|
||||||
}
|
}
|
||||||
|
else if (IS_SOEXT(ext) || IS_DLEXT(ext)) {
|
||||||
|
return Qfalse; /* may be overriden by .rb file */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (rb_feature_p(feature, feature + strlen(feature), Qtrue))
|
||||||
|
return Qtrue;
|
||||||
|
|
||||||
return Qfalse;
|
return Qfalse;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
#define RUBY_VERSION "1.8.6"
|
#define RUBY_VERSION "1.8.6"
|
||||||
#define RUBY_RELEASE_DATE "2007-02-28"
|
#define RUBY_RELEASE_DATE "2007-03-01"
|
||||||
#define RUBY_VERSION_CODE 186
|
#define RUBY_VERSION_CODE 186
|
||||||
#define RUBY_RELEASE_CODE 20070228
|
#define RUBY_RELEASE_CODE 20070301
|
||||||
#define RUBY_PATCHLEVEL 5000
|
#define RUBY_PATCHLEVEL 5000
|
||||||
|
|
||||||
#define RUBY_VERSION_MAJOR 1
|
#define RUBY_VERSION_MAJOR 1
|
||||||
#define RUBY_VERSION_MINOR 8
|
#define RUBY_VERSION_MINOR 8
|
||||||
#define RUBY_VERSION_TEENY 6
|
#define RUBY_VERSION_TEENY 6
|
||||||
#define RUBY_RELEASE_YEAR 2007
|
#define RUBY_RELEASE_YEAR 2007
|
||||||
#define RUBY_RELEASE_MONTH 2
|
#define RUBY_RELEASE_MONTH 3
|
||||||
#define RUBY_RELEASE_DAY 28
|
#define RUBY_RELEASE_DAY 1
|
||||||
|
|
||||||
RUBY_EXTERN const char ruby_version[];
|
RUBY_EXTERN const char ruby_version[];
|
||||||
RUBY_EXTERN const char ruby_release_date[];
|
RUBY_EXTERN const char ruby_release_date[];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue