1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* encoding.c (rb_enc_compatible): 1st argument (typically the

receiver) would have higher priority in encoding detection.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14220 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2007-12-13 17:30:54 +00:00
parent c3b5279d49
commit e0334fb250
2 changed files with 6 additions and 1 deletions

View file

@ -1,3 +1,8 @@
Fri Dec 14 02:29:32 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
* encoding.c (rb_enc_compatible): 1st argument (typically the
receiver) would have higher priority in encoding detection.
Fri Dec 14 02:05:42 2007 Yukihiro Matsumoto <matz@ruby-lang.org> Fri Dec 14 02:05:42 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
* io.c (rb_io_synchronized): should check if initialized. * io.c (rb_io_synchronized): should check if initialized.

View file

@ -399,7 +399,7 @@ rb_enc_compatible(VALUE str1, VALUE str2)
} }
if (cr2 == ENC_CODERANGE_7BIT) { if (cr2 == ENC_CODERANGE_7BIT) {
if (idx1 == 0) return rb_enc_from_index(idx2); if (idx1 == 0) return rb_enc_from_index(idx2);
if (idx2 == 0) return rb_enc_from_index(idx1); return rb_enc_from_index(idx1);
} }
} }
if (cr1 == ENC_CODERANGE_7BIT && if (cr1 == ENC_CODERANGE_7BIT &&