summaryrefslogtreecommitdiff
path: root/re.c
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-02-25 07:48:31 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-02-25 07:48:31 +0000
commitbf524be10c1fbc28e59d11d17fc7147f53129cb5 (patch)
tree46b3543720ecd6cb3b610d1df30215c1b4cb128c /re.c
parent616b11e2464c160729e0bf9525f28e9574d3d1d2 (diff)
merge revision(s) 53167: [Backport #11825]
* re.c (reg_names_iter): should consider encoding of regexp. [ruby-core:72185] [Bug #11825] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@53920 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 're.c')
-rw-r--r--re.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/re.c b/re.c
index c78d57858a..bb1a54c3d8 100644
--- a/re.c
+++ b/re.c
@@ -759,7 +759,7 @@ reg_names_iter(const OnigUChar *name, const OnigUChar *name_end,
int back_num, int *back_refs, OnigRegex regex, void *arg)
{
VALUE ary = (VALUE)arg;
- rb_ary_push(ary, rb_str_new((const char *)name, name_end-name));
+ rb_ary_push(ary, rb_enc_str_new((const char *)name, name_end-name, regex->enc));
return 0;
}