Hi,

At Fri, 20 Jun 2003 19:52:07 +0900,
nobu.nokada / softhome.net wrote:
> Index: object.c
> ===================================================================
> RCS file: /cvs/ruby/src/ruby/object.c,v
> retrieving revision 1.119
> diff -u -2 -p -r1.119 object.c

Sorry, this was wrong.  rb_to_id() must return ID instead of
Symbol.


Index: object.c =================================================================== RCS file: /cvs/ruby/src/ruby/object.c,v retrieving revision 1.119 diff -u -2 -p -r1.119 object.c --- object.c 26 May 2003 08:22:28 -0000 1.119 +++ object.c 20 Jun 2003 11:14:57 -0000 @@ -789,5 +789,6 @@ rb_to_id(name) switch (TYPE(name)) { case T_STRING: - return rb_intern(RSTRING(name)->ptr); + tmp = rb_str_intern(name); + return SYM2ID(tmp); case T_FIXNUM: rb_warn("do not use Fixnums as Symbols"); @@ -803,5 +804,6 @@ rb_to_id(name) tmp = rb_check_string_type(name); if (!NIL_P(tmp)) { - return rb_intern(RSTRING(tmp)->ptr); + tmp = rb_str_intern(tmp); + return SYM2ID(tmp); } rb_raise(rb_eTypeError, "%s is not a symbol", RSTRING(rb_inspect(name))->ptr);
-- Nobu Nakada