зеркало из https://github.com/github/ruby.git
* 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:
Родитель
d64a975396
Коммит
1701a536d1
|
@ -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.
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче