From 7bfed9613cadef52574df8b3c7e1e6324d7230c4 Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 9 Nov 2007 06:52:02 +0000 Subject: [PATCH] * encoding.c (enc_check_encoding, rb_set_primary_encoding): ENCODING is no longer in FL_USERS flags. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13852 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ encoding.c | 6 ++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 23c583b8d3..0dcffeca7a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Fri Nov 9 15:52:00 2007 Nobuyoshi Nakada + + * encoding.c (enc_check_encoding, rb_set_primary_encoding): ENCODING + is no longer in FL_USERS flags. + Fri Nov 9 15:20:13 2007 Nobuyoshi Nakada * string.c (rb_str_squeeze_bang): initialize squeezing table if no diff --git a/encoding.c b/encoding.c index 15a2398f05..1ee24c2286 100644 --- a/encoding.c +++ b/encoding.c @@ -48,7 +48,6 @@ enc_new(rb_encoding *encoding) VALUE rb_enc_from_encoding(rb_encoding *encoding) { - VALUE enc; if (!encoding) return 0; if (enc_initialized_p(encoding)) return ENC_FROM_ENCODING(encoding); @@ -63,7 +62,7 @@ enc_check_encoding(VALUE obj) RDATA(obj)->dmark != enc_mark) { return -1; } - index = rb_enc_get_index(obj); + index = rb_enc_to_index(RDATA(obj)->data); if (rb_enc_from_index(index) != RDATA(obj)->data) return -1; return index; @@ -619,8 +618,7 @@ get_primary_encoding(VALUE klass) void rb_set_primary_encoding(VALUE encoding) { - rb_to_encoding(encoding); - primary_encoding_index = ENCODING_GET(encoding); + primary_encoding_index = rb_enc_to_index(rb_to_encoding(encoding)); } static void