From: matz@... (Yukihiro Matsumoto) Date: 1997-08-26T12:11:52+09:00 Subject: [ruby-dev:260] Re: [BUG] MLF まつもと ゆきひろです In message "[ruby-dev:259] Re: [BUG] MLF" on 97/08/26, Yukihiro Matsumoto writes: |まつもと ゆきひろです |--- object.c~ Mon Aug 18 17:15:38 1997 |+++ object.c Tue Aug 26 11:42:31 1997 すいません.このパッチは廃棄して下さい.次を使って下さい. --- object.c~ Mon Aug 18 17:15:38 1997 +++ object.c Tue Aug 26 11:42:31 1997 @@ -404,3 +404,3 @@ { - VALUE super; + VALUE super, cls; @@ -412,3 +412,7 @@ } - return class_new(super); + cls = class_new(super); + /* make metaclass */ + RBASIC(cls)->class = singleton_class_new(RBASIC(super)->class); + + return cls; } @@ -723,3 +727,4 @@ rb_define_method(cClass, "new", class_new_instance, -1); - rb_define_method(cClass, "superclass", class_superclass, -1); + rb_define_method(cClass, "superclass", class_superclass, 0); + rb_define_singleton_method(cClass, "new", class_s_new, -1); rb_undef_method(cClass, "extend_object"); --- eval.c~ Mon Aug 25 17:13:15 1997 +++ eval.c Tue Aug 26 12:00:24 1997 @@ -570,4 +570,6 @@ VALUE epath = rb_class_path(eclass); - fprintf(stderr, ": "); - fwrite(RSTRING(epath)->ptr, 1, RSTRING(epath)->len, stderr); + if (RSTRING(epath)->ptr[0] != '#') { + fprintf(stderr, ": "); + fwrite(RSTRING(epath)->ptr, 1, RSTRING(epath)->len, stderr); + } } @@ -576,3 +578,3 @@ if (RSTRING(errinfo)->len > 0) { - fprintf(stderr, ":"); + fprintf(stderr, ": "); fwrite(RSTRING(errinfo)->ptr, 1, RSTRING(errinfo)->len, stderr); @@ -2288,3 +2290,9 @@ - if (!NIL_P(mesg)) { + if (NIL_P(mesg)) { + mesg = errinfo; + if (!NIL_P(mesg)) { + Check_Type(mesg, T_STRING); + } + } + else { Check_Type(mesg, T_STRING);