# HG changeset patch # User Kenichi Handa # Date 949474614 0 # Node ID bb284bade4d0f185dc40aed8b5c22a09db4c0709 # Parent a2fcbb168adc0fe12a052073f89aa409d0eccccd (e_write): Fix the handling of CODING_FINISH_INSUFFICIENT_SRC. diff -r a2fcbb168adc -r bb284bade4d0 src/fileio.c --- a/src/fileio.c Tue Feb 01 16:47:22 2000 +0000 +++ b/src/fileio.c Wed Feb 02 06:56:54 2000 +0000 @@ -4986,7 +4986,10 @@ 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 @@ } if (nbytes <= 0) break; - nbytes -= coding->consumed; - addr += coding->consumed; start += coding->consumed_char; if (coding->cmp_data) coding_adjust_composition_offset (coding, start);