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

* 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
This commit is contained in:
nobu 2007-12-31 16:29:06 +00:00
parent d64a975396
commit 1701a536d1
2 changed files with 5 additions and 3 deletions

View file

@ -1,3 +1,8 @@
Tue Jan 1 01:29:04 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* 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 <nobu@ruby-lang.org>
* ruby.c (process_options): rejects dummy encoding.

View file

@ -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));
}