From 1701a536d10d6ac87ff93b7c67f5052a4e9a2b12 Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 31 Dec 2007 16:29:06 +0000 Subject: [PATCH] * encoding.c (rb_to_encoding): raises for non-nil, non-encoding, non-string object. [ruby-core:14634] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14822 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ encoding.c | 3 --- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 96253636a4..848d0c7058 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Tue Jan 1 01:29:04 2008 Nobuyoshi Nakada + + * encoding.c (rb_to_encoding): raises for non-nil, non-encoding, + non-string object. [ruby-core:14634] + Tue Jan 1 01:04:06 2008 Nobuyoshi Nakada * ruby.c (process_options): rejects dummy encoding. diff --git a/encoding.c b/encoding.c index 6f1699e6d0..cf044b1cbe 100644 --- a/encoding.c +++ b/encoding.c @@ -100,9 +100,6 @@ rb_to_encoding(VALUE enc) if (NIL_P(enc)) return 0; idx = enc_check_encoding(enc); if (idx >= 0) return RDATA(enc)->data; - if (NIL_P(enc = rb_check_string_type(enc))) { - return 0; - } if ((idx = rb_enc_find_index(StringValueCStr(enc))) < 0) { rb_raise(rb_eArgError, "unknown encoding name - %s", RSTRING_PTR(enc)); }