From fde3e70dfff553626d12aa875e579d272855b2e9 Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 21 Jan 2008 05:36:16 +0000 Subject: * transcode.c (str_transcode): initialize transcoder in rb_transcoding. [ruby-dev:33234] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15153 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- transcode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'transcode.c') diff --git a/transcode.c b/transcode.c index 370bd06c3..1b8e8ee9e 100644 --- a/transcode.c +++ b/transcode.c @@ -311,14 +311,14 @@ str_transcode(int argc, VALUE *argv, VALUE *self) return -1; } - my_transcoding.transcoder = my_transcoder; - while (!final_encoding) { /* loop for multistep transcoding */ /* later, maybe use smaller intermediate strings for very long strings */ if (!(my_transcoder = transcode_dispatch(from_e, to_e))) { rb_raise(rb_eArgError, "transcoding not supported (from %s to %s)", from_e, to_e); } + my_transcoding.transcoder = my_transcoder; + if (my_transcoder->preprocessor) { fromp = sp = (unsigned char *)RSTRING_PTR(str); slen = RSTRING_LEN(str); -- cgit