changeset 27564:bb284bade4d0

(e_write): Fix the handling of CODING_FINISH_INSUFFICIENT_SRC.
author Kenichi Handa <handa@m17n.org>
date Wed, 02 Feb 2000 06:56:54 +0000
parents a2fcbb168adc
children 6182de7d0e86
files src/fileio.c
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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);