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_associate_index): doesn't clear coderange

when new encoding equals to old one.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15554 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
naruse 2008-02-20 10:44:28 +00:00
parent 492f431a46
commit 1e0958098f
2 changed files with 7 additions and 0 deletions

View file

@ -1,3 +1,8 @@
Wed Feb 20 19:42:03 2008 NARUSE, Yui <naruse@ruby-lang.org>
* encoding.c (rb_enc_associate_index): doesn't clear coderange
when new encoding equals to old one.
Wed Feb 20 19:15:38 2008 NARUSE, Yui <naruse@ruby-lang.org>
* string.c (rb_enc_str_copy): added for wrapper for rb_enc_copy.

View file

@ -613,6 +613,8 @@ void
rb_enc_associate_index(VALUE obj, int idx)
{
enc_check_capable(obj);
if (rb_enc_get_index(obj) == idx)
return;
if (!ENC_CODERANGE_ASCIIONLY(obj) ||
!rb_enc_asciicompat(rb_enc_from_index(idx))) {
ENC_CODERANGE_CLEAR(obj);