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

* encoding.c (enc_find): mistakenly remained !. [Bug #5150]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32823 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2011-08-02 22:46:34 +00:00
parent 7340796338
commit a0b9f48674
3 changed files with 8 additions and 1 deletions

View file

@ -1,3 +1,7 @@
Wed Aug 3 07:46:30 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
* encoding.c (enc_find): mistakenly remained !. [Bug #5150]
Wed Aug 3 00:11:08 2011 Tanaka Akira <akr@fsij.org>
* lib/prettyprint.rb: update document. [ruby-core:36776]

View file

@ -1054,7 +1054,7 @@ static VALUE
enc_find(VALUE klass, VALUE enc)
{
int idx;
if (!SPECIAL_CONST_P(enc) && BUILTIN_TYPE(enc) == T_DATA && is_data_encoding(enc))
if (RB_TYPE_P(enc, T_DATA) && is_data_encoding(enc))
return enc;
idx = str_to_encindex(enc);
if (idx == UNSPECIFIED_ENCODING) return Qnil;

View file

@ -50,6 +50,9 @@ class TestEncoding < Test::Unit::TestCase
exit Encoding.find("filesystem") == Encoding::EUC_JP
EOS
end
bug5150 = '[ruby-dev:44327]'
assert_raise(TypeError, bug5150) {Encoding.find(1)}
end
def test_replicate