From a57d295e36980fe7667f5557c4741339d7684fdc Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 12 Jun 2017 04:35:53 +0000 Subject: iseq.c: preserve encoding * iseq.c (iseqw_inspect): preserve path encoding in the result. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59065 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- iseq.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'iseq.c') diff --git a/iseq.c b/iseq.c index 0d66f5a603..a4e86677c9 100644 --- a/iseq.c +++ b/iseq.c @@ -983,14 +983,15 @@ static VALUE iseqw_inspect(VALUE self) { const rb_iseq_t *iseq = iseqw_check(self); + VALUE klass = rb_class_name(rb_obj_class(self)); if (!iseq->body->location.label) { - return rb_sprintf("#<%s: uninitialized>", rb_obj_classname(self)); + return rb_sprintf("#<%"PRIsVALUE": uninitialized>", klass); } else { - return rb_sprintf("<%s:%s@%s>", - rb_obj_classname(self), - RSTRING_PTR(iseq->body->location.label), RSTRING_PTR(rb_iseq_path(iseq))); + return rb_sprintf("<%"PRIsVALUE":%"PRIsVALUE"@%"PRIsVALUE">", + klass, + iseq->body->location.label, rb_iseq_path(iseq)); } } -- cgit v1.2.3