diff options
| author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-12 08:17:27 +0000 |
|---|---|---|
| committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-12 08:17:27 +0000 |
| commit | 0035d04bc088fdcc304dfa615618356ee668e453 (patch) | |
| tree | 190a2eb58688f03ba7005fe1e367a3068c78c25d | |
| parent | 71c74e892c2e594cdccb839c0741ca5d132cf668 (diff) | |
| download | ruby-0035d04bc088fdcc304dfa615618356ee668e453.tar.gz ruby-0035d04bc088fdcc304dfa615618356ee668e453.tar.xz ruby-0035d04bc088fdcc304dfa615618356ee668e453.zip | |
* transcode.c (trans_open_i): check the result of rb_transcoding_open.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18526 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 4 | ||||
| -rw-r--r-- | transcode.c | 6 |
2 files changed, 9 insertions, 1 deletions
@@ -1,3 +1,7 @@ +Tue Aug 12 17:16:58 2008 Tanaka Akira <akr@fsij.org> + + * transcode.c (trans_open_i): check the result of rb_transcoding_open. + Tue Aug 12 16:23:32 2008 Narihiro Nakamura <authorNari@gmail.com> * gc.c (gc_profile_result): use rb_str_catf. diff --git a/transcode.c b/transcode.c index df198b119..c05bb7d82 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; |
