summaryrefslogtreecommitdiff
path: root/re.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-03-27 09:08:54 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-03-27 09:08:54 (GMT)
commitffdb3ce9b9ca8696d04fd7319ee5f77b532b1f0b (patch)
tree8b38d2813011a177e515f3b95237894853908ec5 /re.c
parent2dc8f669a8874d89e719b7d96b7249fa92c27c11 (diff)
re.c: class name encoding
* re.c (match_inspect): preserve class name encoding by PRIsVALUE. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45449 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 're.c')
-rw-r--r--re.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/re.c b/re.c
index 3e53982..54ba47c 100644
--- a/re.c
+++ b/re.c
@@ -1898,7 +1898,7 @@ match_inspect_name_iter(const OnigUChar *name, const OnigUChar *name_end,
static VALUE
match_inspect(VALUE match)
{
- const char *cname = rb_obj_classname(match);
+ VALUE cname = rb_class_path(rb_obj_class(match));
VALUE str;
int i;
struct re_registers *regs = RMATCH_REGS(match);
@@ -1907,7 +1907,7 @@ match_inspect(VALUE match)
VALUE regexp = RMATCH(match)->regexp;
if (regexp == 0) {
- return rb_sprintf("#<%s:%p>", cname, (void*)match);
+ return rb_sprintf("#<%"PRIsVALUE":%p>", cname, (void*)match);
}
names = ALLOCA_N(struct backref_name_tag, num_regs);
@@ -1917,7 +1917,7 @@ match_inspect(VALUE match)
match_inspect_name_iter, names);
str = rb_str_buf_new2("#<");
- rb_str_buf_cat2(str, cname);
+ rb_str_append(str, cname);
for (i = 0; i < num_regs; i++) {
VALUE v;