aboutsummaryrefslogtreecommitdiffstats
path: root/src/coding.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/coding.c')
-rw-r--r--src/coding.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/coding.c b/src/coding.c
index b7bc5e6b4f2..e285e1c27f3 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -1349,6 +1349,7 @@ detect_coding_iso2022 (src, src_end, multibytep)
1349 while (mask && src < src_end) 1349 while (mask && src < src_end)
1350 { 1350 {
1351 ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep); 1351 ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep);
1352 retry:
1352 switch (c) 1353 switch (c)
1353 { 1354 {
1354 case ISO_CODE_ESC: 1355 case ISO_CODE_ESC:
@@ -1523,6 +1524,8 @@ detect_coding_iso2022 (src, src_end, multibytep)
1523 && mask & CODING_CATEGORY_MASK_ISO_8_2) 1524 && mask & CODING_CATEGORY_MASK_ISO_8_2)
1524 { 1525 {
1525 int i = 1; 1526 int i = 1;
1527
1528 c = -1;
1526 while (src < src_end) 1529 while (src < src_end)
1527 { 1530 {
1528 ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep); 1531 ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep);
@@ -1535,6 +1538,9 @@ detect_coding_iso2022 (src, src_end, multibytep)
1535 mask &= ~CODING_CATEGORY_MASK_ISO_8_2; 1538 mask &= ~CODING_CATEGORY_MASK_ISO_8_2;
1536 else 1539 else
1537 mask_found |= CODING_CATEGORY_MASK_ISO_8_2; 1540 mask_found |= CODING_CATEGORY_MASK_ISO_8_2;
1541 if (c >= 0)
1542 /* This means that we have read one extra byte. */
1543 goto retry;
1538 } 1544 }
1539 } 1545 }
1540 break; 1546 break;