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

* 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
This commit is contained in:
nobu 2007-11-09 06:52:02 +00:00
parent 03d68e3ba4
commit 7bfed9613c
2 changed files with 7 additions and 4 deletions

View file

@ -1,3 +1,8 @@
Fri Nov 9 15:52:00 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* 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 <nobu@ruby-lang.org> Fri Nov 9 15:20:13 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* string.c (rb_str_squeeze_bang): initialize squeezing table if no * string.c (rb_str_squeeze_bang): initialize squeezing table if no

View file

@ -48,7 +48,6 @@ enc_new(rb_encoding *encoding)
VALUE VALUE
rb_enc_from_encoding(rb_encoding *encoding) rb_enc_from_encoding(rb_encoding *encoding)
{ {
VALUE enc;
if (!encoding) return 0; if (!encoding) return 0;
if (enc_initialized_p(encoding)) if (enc_initialized_p(encoding))
return ENC_FROM_ENCODING(encoding); return ENC_FROM_ENCODING(encoding);
@ -63,7 +62,7 @@ enc_check_encoding(VALUE obj)
RDATA(obj)->dmark != enc_mark) { RDATA(obj)->dmark != enc_mark) {
return -1; 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) if (rb_enc_from_index(index) != RDATA(obj)->data)
return -1; return -1;
return index; return index;
@ -619,8 +618,7 @@ get_primary_encoding(VALUE klass)
void void
rb_set_primary_encoding(VALUE encoding) rb_set_primary_encoding(VALUE encoding)
{ {
rb_to_encoding(encoding); primary_encoding_index = rb_enc_to_index(rb_to_encoding(encoding));
primary_encoding_index = ENCODING_GET(encoding);
} }
static void static void