1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-20 12:40:56 -08:00

(detect_coding_emacs_mule): Fix counting of encoded

byte sequence.
(detect_coding_ccl): Fix setting of the variable valids.
This commit is contained in:
Kenichi Handa 2004-03-08 23:15:42 +00:00
parent 608aa380cf
commit 0e219d5467

View file

@ -1808,14 +1808,19 @@ detect_coding_emacs_mule (coding, detect_info)
}
else
{
const unsigned char *src_base = src - 1;
int more_bytes = emacs_mule_bytes[*src_base] - 1;
do
while (more_bytes > 0)
{
ONE_MORE_BYTE (c);
if (c < 0xA0)
{
src--; /* Unread the last byte. */
break;
}
more_bytes--;
}
while (c >= 0xA0);
if (src - src_base != emacs_mule_bytes[*src_base])
if (more_bytes != 0)
break;
found = CATEGORY_MASK_EMACS_MULE;
}
@ -4354,13 +4359,14 @@ detect_coding_ccl (coding, detect_info)
int multibytep = coding->src_multibyte;
int consumed_chars = 0;
int found = 0;
unsigned char *valids = CODING_CCL_VALIDS (coding);
unsigned char *valids;
int head_ascii = coding->head_ascii;
Lisp_Object attrs;
detect_info->checked |= CATEGORY_MASK_CCL;
coding = &coding_categories[coding_category_ccl];
valids = CODING_CCL_VALIDS (coding);
attrs = CODING_ID_ATTRS (coding->id);
if (! NILP (CODING_ATTR_ASCII_COMPAT (attrs)))
src += head_ascii;