From: Nobuyoshi Nakada Date: 2007-02-26T00:35:52+09:00 Subject: [ruby-dev:30418] Re: fail to autoload at $SAFE==4 (Re: Ruby 1.8.6 preview2 has been released) なかだです。 At Sun, 25 Feb 2007 18:41:16 +0900, Hidetoshi NAGAI wrote in [ruby-dev:30414]: > $SAFE==0 などで autoload が適切に設定されている場合, > $SAFE の値に無関係にきちんと load されるべきと思いますし, > 事実,これまではそのように働いていたのですが, > 20070219 の commit の結果,うまく機能しないようになっています. すいません。これでどうでしょう。 Index: eval.c =================================================================== --- eval.c (revision 11791) +++ eval.c (working copy) @@ -6938,4 +6938,7 @@ static const char *const loadable_ext[] }; +static int rb_feature_p _((const char *, const char *, int)); +static int search_required _((VALUE, VALUE *, VALUE *)); + static int rb_feature_p(feature, ext, rb) @@ -6974,5 +6977,5 @@ rb_feature_p(feature, ext, rb) if (loading_tbl) { if (st_lookup(loading_tbl, (st_data_t)feature, 0)) { - if (ext) return 'u'; + if (!ext) return 'u'; return strcmp(ext, ".rb") ? 's' : 'r'; } @@ -6994,6 +6997,4 @@ rb_feature_p(feature, ext, rb) } -static int search_required(VALUE, VALUE *, VALUE *); - int rb_provided(feature) @@ -7004,9 +7005,4 @@ rb_provided(feature) if (rb_feature_p(feature, 0, Qfalse)) return Qtrue; - if (search_required(rb_str_new2(feature), &fname, &path) != 0) { - feature = RSTRING_PTR(fname); - if (rb_feature_p(feature, strrchr(feature, '.'), Qfalse)) - return Qtrue; - } return Qfalse; } -- --- 僕の前にBugはない。 --- 僕の後ろにBugはできる。 中田 伸悦