diff options
| author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-10-17 02:30:57 +0000 |
|---|---|---|
| committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-10-17 02:30:57 +0000 |
| commit | 447a843c8104fc15310c74f16c74bc9f5fcaf3d6 (patch) | |
| tree | 9750062206ff7b66dfb959a7fc0042eeefc9031a /re.c | |
| parent | 1ed88df67f94e52007176cb8a5cb85a66658d69b (diff) | |
| download | ruby-447a843c8104fc15310c74f16c74bc9f5fcaf3d6.tar.gz ruby-447a843c8104fc15310c74f16c74bc9f5fcaf3d6.tar.xz ruby-447a843c8104fc15310c74f16c74bc9f5fcaf3d6.zip | |
* encoding.c (rb_enc_from_encoding, rb_enc_register): associate index
to self.
* encoding.c (enc_capable): Encoding objects are encoding capable.
* re.c (rb_reg_s_union): check if encoding matching by exact encoding
objects.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13732 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 're.c')
| -rw-r--r-- | re.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -1783,7 +1783,7 @@ rb_reg_s_union(VALUE self, VALUE args0) else { int i; VALUE source = rb_str_buf_new(0); - VALUE tmp = rb_ary_entry(args0, 0); + VALUE enc0 = rb_obj_encoding(rb_ary_entry(args0, 0)); for (i = 0; i < argc; i++) { volatile VALUE v; @@ -1792,12 +1792,12 @@ rb_reg_s_union(VALUE self, VALUE args0) rb_str_buf_cat2(source, "|"); v = rb_check_regexp_type(e); if (!NIL_P(v)) { - rb_enc_check(tmp, v); + rb_enc_check(enc0, v); v = rb_reg_to_s(v); } else { - rb_enc_check(tmp, e); v = rb_reg_s_quote(Qnil, e); + rb_enc_check(enc0, rb_obj_encoding(v)); } rb_str_append(source, v); } |
