changeset 89681:7db58df4781a

(Fccl_execute_on_string): Fix the condition of loop.
author Kenichi Handa <handa@m17n.org>
date Mon, 29 Dec 2003 07:51:22 +0000
parents 9f9a2db0bc5a
children 0747ef3c747c
files src/ccl.c
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/ccl.c	Mon Dec 29 07:50:51 2003 +0000
+++ b/src/ccl.c	Mon Dec 29 07:51:22 2003 +0000
@@ -2023,7 +2023,7 @@
 
   consumed_chars = consumed_bytes = 0;
   produced_chars = 0;
-  while (consumed_bytes < str_bytes)
+  while (1)
     {
       const unsigned char *p = SDATA (str) + consumed_bytes;
       const unsigned char *endp = SDATA (str) + str_bytes;
@@ -2047,8 +2047,6 @@
 	{
 	  ccl_driver (&ccl, src, destination, src_size, CCL_EXECUTE_BUF_SIZE,
 		      Qnil);
-	  if (ccl.status != CCL_STAT_SUSPEND_BY_DST)
-	    break;
 	  produced_chars += ccl.produced;
 	  if (NILP (unibyte_p))
 	    {
@@ -2077,6 +2075,8 @@
 	    }
 	  src += ccl.consumed;
 	  src_size -= ccl.consumed;
+	  if (ccl.status != CCL_STAT_SUSPEND_BY_DST)
+	    break;
 	}
 
       if (ccl.status != CCL_STAT_SUSPEND_BY_SRC)