From ca91fb26ce839448e5bf939497ba6a9dd0390a2c Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Wed, 2 Feb 2000 06:58:58 +0000 Subject: [PATCH] (e_write): Fix the handling of CODING_FINISH_INSUFFICIENT_SRC. --- src/ChangeLog | 5 +++++ src/fileio.c | 7 ++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 4f84dbba9c5..dbf0522b392 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2000-02-02 Kenichi Handa + + * fileio.c (e_write): Fix the handling of + CODING_FINISH_INSUFFICIENT_SRC. + 2000-02-01 Dave Love * editfns.c (Fpropertize): Doc fix. diff --git a/src/fileio.c b/src/fileio.c index c3f2a2c9cba..127d883a044 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -4986,7 +4986,10 @@ e_write (desc, string, start, end, coding) break; } } - if (result == CODING_FINISH_INSUFFICIENT_SRC) + nbytes -= coding->consumed; + addr += coding->consumed; + if (result == CODING_FINISH_INSUFFICIENT_SRC + && nbytes > 0) { /* The source text ends by an incomplete multibyte form. There's no way other than write it out as is. */ @@ -4999,8 +5002,6 @@ e_write (desc, string, start, end, coding) } if (nbytes <= 0) break; - nbytes -= coding->consumed; - addr += coding->consumed; start += coding->consumed_char; if (coding->cmp_data) coding_adjust_composition_offset (coding, start); -- 2.39.5