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

ruby-changes:7008

From: akr <ko1@a...>
Date: Tue, 12 Aug 2008 17:17:41 +0900 (JST)
Subject: [ruby-changes:7008] Ruby:r18526 (trunk): * transcode.c (trans_open_i): check the result of rb_transcoding_open.

akr	2008-08-12 17:17:27 +0900 (Tue, 12 Aug 2008)

  New Revision: 18526

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=18526

  Log:
    * transcode.c (trans_open_i): check the result of rb_transcoding_open.

  Modified files:
    trunk/ChangeLog
    trunk/transcode.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 18525)
+++ ChangeLog	(revision 18526)
@@ -1,3 +1,7 @@
+Tue Aug 12 17:16:58 2008  Tanaka Akira  <akr@f...>
+
+	* transcode.c (trans_open_i): check the result of rb_transcoding_open.
+
 Tue Aug 12 16:23:32 2008  Narihiro Nakamura  <authorNari@g...>
 
 	* gc.c (gc_profile_result): use rb_str_catf.
Index: transcode.c
===================================================================
--- transcode.c	(revision 18525)
+++ transcode.c	(revision 18526)
@@ -608,6 +608,7 @@
     rb_trans_t **tsp = (rb_trans_t **)arg;
     rb_trans_t *ts;
     int i;
+    rb_transcoding *tc;
 
     if (!*tsp) {
         ts = *tsp = ALLOC(rb_trans_t);
@@ -627,7 +628,10 @@
         ts = *tsp;
     }
 
-    ts->elems[depth].tc = rb_transcoding_open(from, to, 0);
+    ts->elems[depth].tc = tc = rb_transcoding_open(from, to, 0);
+    if (!tc) {
+        rb_raise(rb_eArgError, "transcoding open failed (from %s to %s)", from, to);
+    }
     if (depth < ts->num_trans-1) {
         int bufsize = 4096;
         unsigned char *p;

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

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