mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1002 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
12d1bc6bd5
commit
52f90f6566
6 changed files with 48 additions and 15 deletions
2
struct.c
2
struct.c
|
@ -341,6 +341,7 @@ rb_struct_to_s(s)
|
|||
VALUE str = rb_str_new(0, strlen(cname) + 4);
|
||||
|
||||
sprintf(RSTRING(str)->ptr, "#<%s>", cname);
|
||||
RSTRING(str)->len = strlen(RSTRING(str)->ptr);
|
||||
return str;
|
||||
}
|
||||
|
||||
|
@ -389,6 +390,7 @@ rb_struct_inspect(s)
|
|||
VALUE str = rb_str_new(0, strlen(cname) + 8);
|
||||
|
||||
sprintf(RSTRING(str)->ptr, "#<%s:...>", cname);
|
||||
RSTRING(str)->len = strlen(RSTRING(str)->ptr);
|
||||
return str;
|
||||
}
|
||||
return rb_protect_inspect(inspect_struct, s, 0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue