mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* re.c (rb_reg_s_union): encoding of all regexp objects should
match. [ruby-dev:32076] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13716 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
4ad19a7dee
commit
9f00119776
2 changed files with 9 additions and 0 deletions
|
@ -1,3 +1,8 @@
|
|||
Tue Oct 16 14:03:09 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* re.c (rb_reg_s_union): encoding of all regexp objects should
|
||||
match. [ruby-dev:32076]
|
||||
|
||||
Tue Oct 16 13:49:41 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* encoding.c (enc_to_s): rename function.
|
||||
|
|
4
re.c
4
re.c
|
@ -1997,6 +1997,7 @@ static VALUE
|
|||
rb_reg_s_union(VALUE self, VALUE args0)
|
||||
{
|
||||
long argc = RARRAY_LEN(args0);
|
||||
|
||||
if (argc == 0) {
|
||||
VALUE args[1];
|
||||
args[0] = rb_str_new2("(?!)");
|
||||
|
@ -2018,11 +2019,14 @@ rb_reg_s_union(VALUE self, VALUE args0)
|
|||
VALUE kcode_re = Qnil;
|
||||
VALUE source = rb_str_buf_new(0);
|
||||
VALUE args[3];
|
||||
VALUE tmp = rb_ary_entry(args0, 0);
|
||||
|
||||
for (i = 0; i < argc; i++) {
|
||||
volatile VALUE v;
|
||||
if (0 < i)
|
||||
rb_str_buf_cat2(source, "|");
|
||||
v = rb_check_regexp_type(rb_ary_entry(args0, i));
|
||||
rb_enc_check(tmp, v);
|
||||
if (!NIL_P(v)) {
|
||||
if (FL_TEST(v, KCODE_FIXED)) {
|
||||
if (kcode == -1) {
|
||||
|
|
Loading…
Reference in a new issue