[前][次][番号順一覧][スレッド一覧]

ruby-changes:2914

From: ko1@a...
Date: 21 Dec 2007 15:16:19 +0900
Subject: [ruby-changes:2914] nobu - Ruby:r14405 (trunk): * encoding.c (rb_to_encoding_index): should return error instead of

nobu	2007-12-21 15:16:02 +0900 (Fri, 21 Dec 2007)

  New Revision: 14405

  Modified files:
    trunk/ChangeLog
    trunk/encoding.c

  Log:
    * encoding.c (rb_to_encoding_index): should return error instead of
      exception even if type is incorrect.


  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=14405&r2=14404
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/encoding.c?r1=14405&r2=14404

Index: encoding.c
===================================================================
--- encoding.c	(revision 14404)
+++ encoding.c	(revision 14405)
@@ -81,6 +81,9 @@
     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));
     }
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 14404)
+++ ChangeLog	(revision 14405)
@@ -1,3 +1,8 @@
+Fri Dec 21 15:16:00 2007  Nobuyoshi Nakada  <nobu@r...>
+
+	* 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@r...>
 
 	* enumerator.c (enumerator_init_copy): prohibit cloning of

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml

[前][次][番号順一覧][スレッド一覧]