summaryrefslogtreecommitdiff
path: root/object.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-10-13 09:01:58 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-10-13 09:01:58 +0000
commit52f90f65668e479cd712e2e3bbd0dc80925816fe (patch)
tree2923343175f8d63a52649189131c6e642b4574dd /object.c
parent12d1bc6bd53eabee9442c79d41b698b0bf3ac7d8 (diff)
matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1002 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'object.c')
-rw-r--r--object.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/object.c b/object.c
index 7f18675..353d322 100644
--- a/object.c
+++ b/object.c
@@ -134,6 +134,7 @@ rb_any_to_s(obj)
str = rb_str_new(0, strlen(cname)+6+16+1); /* 6:tags 16:addr 1:eos */
sprintf(RSTRING(str)->ptr, "#<%s:0x%lx>", cname, obj);
+ RSTRING(str)->len = strlen(RSTRING(str)->ptr);
if (OBJ_TAINTED(obj)) OBJ_TAINT(str);
return str;
@@ -199,10 +200,12 @@ rb_obj_inspect(obj)
if (rb_inspecting_p(obj)) {
str = rb_str_new(0, strlen(c)+8+16+1); /* 8:tags 16:addr 1:eos */
sprintf(RSTRING(str)->ptr, "#<%s:0x%lx ...>", c, obj);
+ RSTRING(str)->len = strlen(RSTRING(str)->ptr);
return str;
}
str = rb_str_new(0, strlen(c)+4+16+1); /* 4:tags 16:addr 1:eos */
sprintf(RSTRING(str)->ptr, "-<%s:0x%lx ", c, obj);
+ RSTRING(str)->len = strlen(RSTRING(str)->ptr);
return rb_protect_inspect(inspect_obj, obj, str);
}
return rb_funcall(obj, rb_intern("to_s"), 0, 0);
@@ -498,6 +501,7 @@ sym_inspect(sym)
str = rb_str_new(0, strlen(name)+2);
name = rb_id2name(SYM2ID(sym));
sprintf(RSTRING(str)->ptr, ":%s", name);
+ RSTRING(str)->len = strlen(RSTRING(str)->ptr);
return str;
}