* 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
@ -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>
|
Fri Dec 21 14:58:27 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
* enumerator.c (enumerator_init_copy): prohibit cloning of
|
* enumerator.c (enumerator_init_copy): prohibit cloning of
|
||||||
|
@ -81,6 +81,9 @@ rb_to_encoding_index(VALUE enc)
|
|||||||
if (idx >= 0) {
|
if (idx >= 0) {
|
||||||
return idx;
|
return idx;
|
||||||
}
|
}
|
||||||
|
else if (NIL_P(enc = rb_check_string_type(enc))) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
return rb_enc_find_index(StringValueCStr(enc));
|
return rb_enc_find_index(StringValueCStr(enc));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user