---
Ken'ichi HANDA
handa@m17n.org
2002-10-08 Kenichi Handa <handa@m17n.org>
* coding.c (code_convert_region): When we need more GAP for
conversion, pay attention to the case that coding->produced is not
greater than coding->consumed.
Index: coding.c
===================================================================
RCS file: /cvs/emacs/src/coding.c,v
retrieving revision 1.259
retrieving revision 1.260
diff -u -c -r1.259 -r1.260
cvs server: conflicting specifications of output style
*** coding.c 30 Sep 2002 06:28:31 -0000 1.259
--- coding.c 8 Oct 2002 00:57:59 -0000 1.260
***************
*** 5696,5704 ****
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;
first = 0;
}
if ((src - dst) < (require + 2000))
--- 5696,5714 ----
REQUIRE + LEN_BYTE = LEN_BYTE * (NEW / ORIG)
REQUIRE = LEN_BYTE * (NEW - ORIG) / ORIG
Here, we are sure that NEW >= ORIG. */
! 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))