diff --git a/ChangeLog b/ChangeLog index ff399a4052..8f66bc8534 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Wed Aug 27 01:13:54 2008 Tanaka Akira + + * transcode.c (transcode_loop): simplified. + Wed Aug 27 01:03:23 2008 Tanaka Akira * include/ruby/encoding.h (rb_econv_result_t): enumeration constant: diff --git a/transcode.c b/transcode.c index 38548bc856..13d7c92452 100644 --- a/transcode.c +++ b/transcode.c @@ -1763,12 +1763,8 @@ transcode_loop(const unsigned char **in_pos, unsigned char **out_pos, ret = rb_econv_convert(ec, in_pos, in_stop, out_pos, out_stop, 0); if (ret == econv_invalid_byte_sequence || - ret == econv_incomplete_input) { - exc = make_econv_exception(ec); - rb_econv_close(ec); - rb_exc_raise(exc); - } - if (ret == econv_undefined_conversion) { + ret == econv_incomplete_input || + ret == econv_undefined_conversion) { exc = make_econv_exception(ec); rb_econv_close(ec); rb_exc_raise(exc); @@ -1831,11 +1827,6 @@ transcode_loop(const unsigned char **in_pos, unsigned char **out_pos, switch (ret) { case econv_invalid_byte_sequence: case econv_incomplete_input: - exc = make_econv_exception(ec); - rb_econv_close(ec); - rb_exc_raise(exc); - break; - case econv_undefined_conversion: exc = make_econv_exception(ec); rb_econv_close(ec);