mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* encoding.c (rb_to_encoding_index): should return error instead of
exception even if type is incorrect. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14405 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
8fa21bc05f
commit
4baea7dd8e
2 changed files with 8 additions and 0 deletions
|
@ -1,3 +1,8 @@
|
|||
Fri Dec 21 15:16:00 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* encoding.c (rb_to_encoding_index): should return error instead of
|
||||
exception even if type is incorrect.
|
||||
|
||||
Fri Dec 21 14:58:27 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* enumerator.c (enumerator_init_copy): prohibit cloning of
|
||||
|
|
|
@ -81,6 +81,9 @@ rb_to_encoding_index(VALUE enc)
|
|||
if (idx >= 0) {
|
||||
return idx;
|
||||
}
|
||||
else if (NIL_P(enc = rb_check_string_type(enc))) {
|
||||
return -1;
|
||||
}
|
||||
else {
|
||||
return rb_enc_find_index(StringValueCStr(enc));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue