changeset 46702:2673ae55a6f9

(detect_coding_iso2022): While checking a byte sequence for CODING_CATEGORY_MASK_ISO_8_2, if we read one extra byte, check it in the normal loop.
author Kenichi Handa <handa@m17n.org>
date Fri, 26 Jul 2002 11:53:25 +0000
parents d5bf1117c68b
children 9bb3ef1e53cd
files src/coding.c
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/coding.c	Fri Jul 26 11:53:10 2002 +0000
+++ b/src/coding.c	Fri Jul 26 11:53:25 2002 +0000
@@ -1349,6 +1349,7 @@
   while (mask && src < src_end)
     {
       ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep);
+    retry:
       switch (c)
 	{
 	case ISO_CODE_ESC:
@@ -1523,6 +1524,8 @@
 		  && mask & CODING_CATEGORY_MASK_ISO_8_2)
 		{
 		  int i = 1;
+
+		  c = -1;
 		  while (src < src_end)
 		    {
 		      ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep);
@@ -1535,6 +1538,9 @@
 		    mask &= ~CODING_CATEGORY_MASK_ISO_8_2;
 		  else
 		    mask_found |= CODING_CATEGORY_MASK_ISO_8_2;
+		  if (c >= 0)
+		    /* This means that we have read one extra byte.  */
+		    goto retry;
 		}
 	    }
 	  break;