summaryrefslogtreecommitdiff
path: root/object.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-11-25 18:44:16 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-11-25 18:44:16 +0000
commitd0ac6d5879c8d2132a7419ff2b8a4fb3b3a28597 (patch)
tree1acb43fac496323b967ae97c47b11a71e09b1926 /object.c
parentf2fc80cebeafdb0c8e354b31825f192c7d40825e (diff)
object.c: preserve encodings
* object.c (inspect_i): preserve encodings in inspected result string. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48574 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'object.c')
-rw-r--r--object.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/object.c b/object.c
index 567dec1..446d52a 100644
--- a/object.c
+++ b/object.c
@@ -489,8 +489,6 @@ inspect_i(st_data_t k, st_data_t v, st_data_t a)
ID id = (ID)k;
VALUE value = (VALUE)v;
VALUE str = (VALUE)a;
- VALUE str2;
- const char *ivname;
/* need not to show internal data */
if (CLASS_OF(value) == 0) return ST_CONTINUE;
@@ -502,12 +500,8 @@ inspect_i(st_data_t k, st_data_t v, st_data_t a)
else {
rb_str_cat2(str, ", ");
}
- ivname = rb_id2name(id);
- rb_str_cat2(str, ivname);
- rb_str_cat2(str, "=");
- str2 = rb_inspect(value);
- rb_str_append(str, str2);
- OBJ_INFECT(str, str2);
+ rb_str_catf(str, "%"PRIsVALUE"=%+"PRIsVALUE,
+ rb_id2str(id), value);
return ST_CONTINUE;
}