diff options
| author | Kenichi Handa | 2002-07-26 11:53:25 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2002-07-26 11:53:25 +0000 |
| commit | 8d239c89c6580517905dfcddc02e176518a475b0 (patch) | |
| tree | 3f0020baf6b68c1b62aa989ea3c97dae4bebfe3c /src/coding.c | |
| parent | 5483cd4e0f5ed9abe40ff25348579714be7201f1 (diff) | |
| download | emacs-8d239c89c6580517905dfcddc02e176518a475b0.tar.gz emacs-8d239c89c6580517905dfcddc02e176518a475b0.zip | |
(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.
Diffstat (limited to 'src/coding.c')
| -rw-r--r-- | src/coding.c | 6 |
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; |