зеркало из https://github.com/github/ruby.git
* re.c (rb_reg_s_union): check for encoding of original object.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13723 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
55eed62a43
Коммит
5d8ba5a43f
|
@ -1,3 +1,7 @@
|
|||
Tue Oct 16 19:48:01 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* re.c (rb_reg_s_union): check for encoding of original object.
|
||||
|
||||
Tue Oct 16 18:28:51 2007 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* debug.c: use enum for constants for gdb if possible.
|
||||
|
|
8
re.c
8
re.c
|
@ -1776,15 +1776,17 @@ rb_reg_s_union(VALUE self, VALUE args0)
|
|||
|
||||
for (i = 0; i < argc; i++) {
|
||||
volatile VALUE v;
|
||||
VALUE e = rb_ary_entry(args0, i);
|
||||
if (0 < i)
|
||||
rb_str_buf_cat2(source, "|");
|
||||
v = rb_check_regexp_type(rb_ary_entry(args0, i));
|
||||
rb_enc_check(tmp, v);
|
||||
v = rb_check_regexp_type(e);
|
||||
if (!NIL_P(v)) {
|
||||
rb_enc_check(tmp, v);
|
||||
v = rb_reg_to_s(v);
|
||||
}
|
||||
else {
|
||||
v = rb_reg_s_quote(Qnil, rb_ary_entry(args0, i));
|
||||
rb_enc_check(tmp, e);
|
||||
v = rb_reg_s_quote(Qnil, e);
|
||||
}
|
||||
rb_str_buf_append(source, v);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче