summaryrefslogtreecommitdiffstats
path: root/re.c
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-01-25 07:35:27 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-01-25 07:35:27 +0000
commit2c2e6ee432bcbdb2e28005021ea2eb42c871c440 (patch)
tree76efd4714a4e19398186edd80c46763bce7a4a0d /re.c
parentc730ae2525228ad54447508980b2f187bc7a3a9b (diff)
downloadruby-2c2e6ee432bcbdb2e28005021ea2eb42c871c440.tar.gz
ruby-2c2e6ee432bcbdb2e28005021ea2eb42c871c440.tar.xz
ruby-2c2e6ee432bcbdb2e28005021ea2eb42c871c440.zip
* include/ruby/intern.h (rb_str_buf_cat_ascii): declared.
* string.c (rb_str_buf_cat_ascii): defined. * re.c (rb_reg_s_union): use rb_str_buf_cat_ascii to support ASCII incompatible encoding. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15232 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 're.c')
-rw-r--r--re.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/re.c b/re.c
index dced068d9..a03bea575 100644
--- a/re.c
+++ b/re.c
@@ -2668,7 +2668,7 @@ rb_reg_s_union(VALUE self, VALUE args0)
VALUE e = rb_ary_entry(args0, i);
if (0 < i)
- rb_str_buf_cat2(source, "|"); /* xxx: UTF-16 */
+ rb_str_buf_cat_ascii(source, "|");
v = rb_check_regexp_type(e);
if (!NIL_P(v)) {
@@ -2726,6 +2726,9 @@ rb_reg_s_union(VALUE self, VALUE args0)
}
}
+ if (i == 0) {
+ rb_enc_copy(source, v);
+ }
rb_str_append(source, v);
}