]> git.eshelyaron.com Git - emacs.git/commitdiff
(detect_coding_iso2022): While checking a byte sequence
authorKenichi Handa <handa@m17n.org>
Wed, 27 Aug 2003 00:32:05 +0000 (00:32 +0000)
committerKenichi Handa <handa@m17n.org>
Wed, 27 Aug 2003 00:32:05 +0000 (00:32 +0000)
for CODING_CATEGORY_MASK_ISO_8_2, if we read one extra byte, check
it in the normal loop.

src/coding.c

index 8d0ecb8b148689f791d51b2d0be64343e498555c..b5399beced659d403531cf9d431ffe56bb9f3306 100644 (file)
@@ -1359,6 +1359,7 @@ detect_coding_iso2022 (src, src_end, multibytep)
   while (mask && src < src_end)
     {
       ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep);
+    retry:
       switch (c)
        {
        case ISO_CODE_ESC:
@@ -1556,6 +1557,8 @@ detect_coding_iso2022 (src, src_end, multibytep)
                  && mask & CODING_CATEGORY_MASK_ISO_8_2)
                {
                  int i = 1;
+
+                 c = -1;
                  while (src < src_end)
                    {
                      ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep);
@@ -1568,6 +1571,9 @@ detect_coding_iso2022 (src, src_end, multibytep)
                    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;