(Fccl_execute_on_string): Fix the condition of terminating
authorKenichi Handa <handa@m17n.org>
Fri, 3 Mar 2006 05:13:48 +0000 (05:13 +0000)
committerKenichi Handa <handa@m17n.org>
Fri, 3 Mar 2006 05:13:48 +0000 (05:13 +0000)
the loop.  When quitted, show a proper error message.

src/ccl.c

index 0ae575f..74d0aff 100644 (file)
--- a/src/ccl.c
+++ b/src/ccl.c
@@ -2167,13 +2167,15 @@ usage: (ccl-execute-on-string CCL-PROGRAM STATUS STRING &optional CONTINUE UNIBY
            break;
        }
 
-      if (ccl.status != CCL_STAT_SUSPEND_BY_SRC)
+      if (ccl.status != CCL_STAT_SUSPEND_BY_SRC
+         || str_chars == consumed_chars)
        break;
     }
 
-  if (ccl.status != CCL_STAT_SUCCESS
-      && ccl.status != CCL_STAT_SUSPEND_BY_SRC)
+  if (ccl.status == CCL_STAT_INVALID_CMD)
     error ("Error in CCL program at %dth code", ccl.ic);
+  if (ccl.status == CCL_STAT_QUIT)
+    error ("CCL program interrupted at %dth code", ccl.ic);
 
   for (i = 0; i < 8; i++)
     ASET (status, i, make_number (ccl.reg[i]));