diff options
| author | Kenichi Handa | 2004-03-08 23:15:42 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2004-03-08 23:15:42 +0000 |
| commit | 0e219d54678ad5cbab31d8feb8aa7e2176a67a64 (patch) | |
| tree | a0055cded2851597a444561aae99d3b8f3343e61 /src/coding.c | |
| parent | 608aa380cffd0645d9ea99abae420ea82a601e5e (diff) | |
| download | emacs-0e219d54678ad5cbab31d8feb8aa7e2176a67a64.tar.gz emacs-0e219d54678ad5cbab31d8feb8aa7e2176a67a64.zip | |
(detect_coding_emacs_mule): Fix counting of encoded
byte sequence.
(detect_coding_ccl): Fix setting of the variable valids.
Diffstat (limited to 'src/coding.c')
| -rw-r--r-- | src/coding.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/coding.c b/src/coding.c index d95da9bf9eb..1cce3d5e381 100644 --- a/src/coding.c +++ b/src/coding.c | |||
| @@ -1808,14 +1808,19 @@ detect_coding_emacs_mule (coding, detect_info) | |||
| 1808 | } | 1808 | } |
| 1809 | else | 1809 | else |
| 1810 | { | 1810 | { |
| 1811 | const unsigned char *src_base = src - 1; | 1811 | int more_bytes = emacs_mule_bytes[*src_base] - 1; |
| 1812 | 1812 | ||
| 1813 | do | 1813 | while (more_bytes > 0) |
| 1814 | { | 1814 | { |
| 1815 | ONE_MORE_BYTE (c); | 1815 | ONE_MORE_BYTE (c); |
| 1816 | if (c < 0xA0) | ||
| 1817 | { | ||
| 1818 | src--; /* Unread the last byte. */ | ||
| 1819 | break; | ||
| 1820 | } | ||
| 1821 | more_bytes--; | ||
| 1816 | } | 1822 | } |
| 1817 | while (c >= 0xA0); | 1823 | if (more_bytes != 0) |
| 1818 | if (src - src_base != emacs_mule_bytes[*src_base]) | ||
| 1819 | break; | 1824 | break; |
| 1820 | found = CATEGORY_MASK_EMACS_MULE; | 1825 | found = CATEGORY_MASK_EMACS_MULE; |
| 1821 | } | 1826 | } |
| @@ -4354,13 +4359,14 @@ detect_coding_ccl (coding, detect_info) | |||
| 4354 | int multibytep = coding->src_multibyte; | 4359 | int multibytep = coding->src_multibyte; |
| 4355 | int consumed_chars = 0; | 4360 | int consumed_chars = 0; |
| 4356 | int found = 0; | 4361 | int found = 0; |
| 4357 | unsigned char *valids = CODING_CCL_VALIDS (coding); | 4362 | unsigned char *valids; |
| 4358 | int head_ascii = coding->head_ascii; | 4363 | int head_ascii = coding->head_ascii; |
| 4359 | Lisp_Object attrs; | 4364 | Lisp_Object attrs; |
| 4360 | 4365 | ||
| 4361 | detect_info->checked |= CATEGORY_MASK_CCL; | 4366 | detect_info->checked |= CATEGORY_MASK_CCL; |
| 4362 | 4367 | ||
| 4363 | coding = &coding_categories[coding_category_ccl]; | 4368 | coding = &coding_categories[coding_category_ccl]; |
| 4369 | valids = CODING_CCL_VALIDS (coding); | ||
| 4364 | attrs = CODING_ID_ATTRS (coding->id); | 4370 | attrs = CODING_ID_ATTRS (coding->id); |
| 4365 | if (! NILP (CODING_ATTR_ASCII_COMPAT (attrs))) | 4371 | if (! NILP (CODING_ATTR_ASCII_COMPAT (attrs))) |
| 4366 | src += head_ascii; | 4372 | src += head_ascii; |