1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* struct.c (inspect_struct): do not display a class name for

anonymous struct.  The member fields are sufficient.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10939 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2006-09-16 02:20:59 +00:00
parent 5300eecfb3
commit de4f255da2
2 changed files with 11 additions and 1 deletions

View file

@ -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.

View file

@ -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;