* 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
@ -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>
|
Fri Jan 11 01:08:01 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
* thread.c (rb_mutex_unlock): proper error message for unlocking
|
* thread.c (rb_mutex_unlock): proper error message for unlocking
|
||||||
|
@ -78,7 +78,6 @@ rb_to_encoding_index(VALUE enc)
|
|||||||
{
|
{
|
||||||
int idx;
|
int idx;
|
||||||
|
|
||||||
if (NIL_P(enc)) return 0;
|
|
||||||
idx = enc_check_encoding(enc);
|
idx = enc_check_encoding(enc);
|
||||||
if (idx >= 0) {
|
if (idx >= 0) {
|
||||||
return idx;
|
return idx;
|
||||||
@ -96,7 +95,6 @@ rb_to_encoding(VALUE enc)
|
|||||||
{
|
{
|
||||||
int idx;
|
int idx;
|
||||||
|
|
||||||
if (NIL_P(enc)) return 0;
|
|
||||||
idx = enc_check_encoding(enc);
|
idx = enc_check_encoding(enc);
|
||||||
if (idx >= 0) return RDATA(enc)->data;
|
if (idx >= 0) return RDATA(enc)->data;
|
||||||
if ((idx = rb_enc_find_index(StringValueCStr(enc))) < 0) {
|
if ((idx = rb_enc_find_index(StringValueCStr(enc))) < 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user