diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | struct.c | 7 |
2 files changed, 11 insertions, 1 deletions
@@ -1,3 +1,8 @@ +Sat Sep 16 09:37:39 2006 Yukihiro Matsumoto <matz@ruby-lang.org> + + * struct.c (inspect_struct): do not display a class name for + anonymous struct. The member fields are sufficient. + Fri Sep 15 20:22:15 2006 NARUSE, Yui <naruse@ruby-lang.org> * ext/nkf/nkf-8/nkf.c: imported nkf 2.0.8 rev.110. @@ -442,7 +442,12 @@ inspect_struct(VALUE s, VALUE dummy, int recur) } members = rb_struct_members(s); - str = rb_sprintf("#<struct %s ", cname); + if (cname[0] == '#') { + str = rb_str_new2("#<struct "); + } + else { + str = rb_sprintf("#<struct %s ", cname); + } for (i=0; i<RSTRUCT_LEN(s); i++) { VALUE slot; ID id; |