diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-07-15 07:55:08 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-07-15 07:55:08 +0000 |
commit | 4a465ed38f839ef97f442e6b0bc00ac3ea456394 (patch) | |
tree | 4c83920b97ecad2a938abff5e3844d590aab4b49 /ext/-test-/string | |
parent | 11d5096bc5b45252fd6a431094db15c1a172ca77 (diff) | |
download | ruby-4a465ed38f839ef97f442e6b0bc00ac3ea456394.tar.gz |
encoding.c: drop dummy encoding flag
* encoding.c (enc_autoload): drop dummy encoding flag from
the loaded encoding index. this flag is used only in this
source.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51251 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/-test-/string')
-rw-r--r-- | ext/-test-/string/enc_associate.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ext/-test-/string/enc_associate.c b/ext/-test-/string/enc_associate.c index d6614fb298..53811620a0 100644 --- a/ext/-test-/string/enc_associate.c +++ b/ext/-test-/string/enc_associate.c @@ -7,8 +7,16 @@ bug_str_enc_associate(VALUE str, VALUE enc) return rb_enc_associate(str, rb_to_encoding(enc)); } +VALUE +bug_str_encoding_index(VALUE self, VALUE str) +{ + int idx = rb_enc_get_index(str); + return INT2NUM(idx); +} + void Init_enc_associate(VALUE klass) { rb_define_method(klass, "associate_encoding!", bug_str_enc_associate, 1); + rb_define_singleton_method(klass, "encoding_index", bug_str_encoding_index, 1); } |