aboutsummaryrefslogtreecommitdiffstats
path: root/transcode.c
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-12 08:17:27 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-12 08:17:27 +0000
commitabef7fa890df87d69e38311b7d0626d790a396aa (patch)
tree190a2eb58688f03ba7005fe1e367a3068c78c25d /transcode.c
parent5b3278b74a1a7edb0885b0ccbfe86ab8f3a53813 (diff)
downloadruby-abef7fa890df87d69e38311b7d0626d790a396aa.tar.gz
* transcode.c (trans_open_i): check the result of rb_transcoding_open.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18526 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'transcode.c')
-rw-r--r--transcode.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/transcode.c b/transcode.c
index df198b1194..c05bb7d823 100644
--- a/transcode.c
+++ b/transcode.c
@@ -608,6 +608,7 @@ trans_open_i(const char *from, const char *to, int depth, void *arg)
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 @@ trans_open_i(const char *from, const char *to, int depth, void *arg)
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;