# HG changeset patch # User Kenichi Handa # Date 1034038679 0 # Node ID 1a71f916ad2f1f5c96e9e7690e19c4fdf9de6d0c # Parent 2eb1a25294abd8b695ef32a3e79ad52e791fd14a (code_convert_region): When we need more GAP for conversion, pay attention to the case that coding->produced is not greater than coding->consumed. diff -r 2eb1a25294ab -r 1a71f916ad2f src/coding.c --- a/src/coding.c Mon Oct 07 22:51:03 2002 +0000 +++ b/src/coding.c Tue Oct 08 00:57:59 2002 +0000 @@ -5696,9 +5696,19 @@ REQUIRE + LEN_BYTE = LEN_BYTE * (NEW / ORIG) REQUIRE = LEN_BYTE * (NEW - ORIG) / ORIG Here, we are sure that NEW >= ORIG. */ - float ratio = coding->produced - coding->consumed; - ratio /= coding->consumed; - require = len_byte * ratio; + float ratio; + + if (coding->produced <= coding->consumed) + { + /* This happens because of CCL-based coding system with + eol-type CRLF. */ + require = 0; + } + else + { + ratio = (coding->produced - coding->consumed) / coding->consumed; + require = len_byte * ratio; + } first = 0; } if ((src - dst) < (require + 2000))