mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* encoding.c (rb_to_encoding_index, rb_to_encoding): disallow nil.
[ruby-dev:33003] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14981 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
d17bcfc802
commit
78900b98b3
2 changed files with 5 additions and 2 deletions
|
@ -1,3 +1,8 @@
|
|||
Fri Jan 11 06:13:14 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* encoding.c (rb_to_encoding_index, rb_to_encoding): disallow nil.
|
||||
[ruby-dev:33003]
|
||||
|
||||
Fri Jan 11 01:08:01 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* thread.c (rb_mutex_unlock): proper error message for unlocking
|
||||
|
|
|
@ -78,7 +78,6 @@ rb_to_encoding_index(VALUE enc)
|
|||
{
|
||||
int idx;
|
||||
|
||||
if (NIL_P(enc)) return 0;
|
||||
idx = enc_check_encoding(enc);
|
||||
if (idx >= 0) {
|
||||
return idx;
|
||||
|
@ -96,7 +95,6 @@ rb_to_encoding(VALUE enc)
|
|||
{
|
||||
int idx;
|
||||
|
||||
if (NIL_P(enc)) return 0;
|
||||
idx = enc_check_encoding(enc);
|
||||
if (idx >= 0) return RDATA(enc)->data;
|
||||
if ((idx = rb_enc_find_index(StringValueCStr(enc))) < 0) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue