aboutsummaryrefslogtreecommitdiffstats
path: root/src/coding.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/coding.c')
-rw-r--r--src/coding.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/coding.c b/src/coding.c
index 4636a0712fe..69e3b7e3e3d 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -5696,9 +5696,19 @@ code_convert_region (from, from_byte, to, to_byte, coding, encodep, replace)
5696 REQUIRE + LEN_BYTE = LEN_BYTE * (NEW / ORIG) 5696 REQUIRE + LEN_BYTE = LEN_BYTE * (NEW / ORIG)
5697 REQUIRE = LEN_BYTE * (NEW - ORIG) / ORIG 5697 REQUIRE = LEN_BYTE * (NEW - ORIG) / ORIG
5698 Here, we are sure that NEW >= ORIG. */ 5698 Here, we are sure that NEW >= ORIG. */
5699 float ratio = coding->produced - coding->consumed; 5699 float ratio;
5700 ratio /= coding->consumed; 5700
5701 require = len_byte * ratio; 5701 if (coding->produced <= coding->consumed)
5702 {
5703 /* This happens because of CCL-based coding system with
5704 eol-type CRLF. */
5705 require = 0;
5706 }
5707 else
5708 {
5709 ratio = (coding->produced - coding->consumed) / coding->consumed;
5710 require = len_byte * ratio;
5711 }
5702 first = 0; 5712 first = 0;
5703 } 5713 }
5704 if ((src - dst) < (require + 2000)) 5714 if ((src - dst) < (require + 2000))