summaryrefslogtreecommitdiff
path: root/re.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-10-16 18:37:09 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-10-16 18:37:09 +0000
commitb06a606278f48ff10ef6dfecb2f819f7caac8c19 (patch)
treed058259046b62874faa7f7461555270524db9440 /re.c
parent59609a4fba53c86b8e179dc1c000610e56ba135c (diff)
downloadruby-b06a606278f48ff10ef6dfecb2f819f7caac8c19.tar.gz
* re.c (rb_reg_desc): set encoding.
* re.c (rb_reg_s_union): check encodings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13728 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 're.c')
-rw-r--r--re.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/re.c b/re.c
index d6bff5ea94..605c40f176 100644
--- a/re.c
+++ b/re.c
@@ -266,6 +266,7 @@ rb_reg_desc(const char *s, long len, VALUE re)
{
VALUE str = rb_str_buf_new2("/");
+ rb_enc_copy(str, re);
rb_reg_expr_str(str, s, len);
rb_str_buf_cat2(str, "/");
if (re) {
@@ -1798,7 +1799,7 @@ rb_reg_s_union(VALUE self, VALUE args0)
rb_enc_check(tmp, e);
v = rb_reg_s_quote(Qnil, e);
}
- rb_str_buf_append(source, v);
+ rb_str_append(source, v);
}
return rb_class_new_instance(1, &source, rb_cRegexp);
}