Commit 0fc71a77 authored by Kenichi Handa's avatar Kenichi Handa
Browse files

(ccl_driver) [CCL_ReadMultibyteChar2]: If SRC points an

invalid mulitbyte sequence, treat *SRC as a character of
eight-bit-graphic.
parent 2a55cd3a
2001-02-15 Kenichi Handa <handa@etl.go.jp>
* ccl.c (ccl_driver) [CCL_ReadMultibyteChar2]: If SRC points an
invalid multibyte sequence, treat *SRC as a character of
eight-bit-graphic.
2001-02-15 Eli Zaretskii <eliz@is.elta.co.il>
* textprop.c (Fset_text_properties): Doc fix.
......
......@@ -1255,21 +1255,27 @@ ccl_driver (ccl, source, destination, src_bytes, dst_bytes, consumed)
reg[rrr] = i;
reg[RRR] = CHARSET_ASCII;
}
else if (i <= MAX_CHARSET_OFFICIAL_DIMENSION1)
{
if (src >= src_end)
goto ccl_read_multibyte_character_suspend;
reg[RRR] = i;
reg[rrr] = (*src++ & 0x7F);
}
else if (i <= MAX_CHARSET_OFFICIAL_DIMENSION2)
{
if ((src + 1) >= src_end)
int dimension = BYTES_BY_CHAR_HEAD (i) - 1;
if (dimension == 0)
{
/* `i' is a leading code for an undefined charset. */
reg[RRR] = CHARSET_8_BIT_GRAPHIC;
reg[rrr] = i;
}
else if (src + dimension > src_end)
goto ccl_read_multibyte_character_suspend;
reg[RRR] = i;
i = (*src++ & 0x7F);
reg[rrr] = ((i << 7) | (*src & 0x7F));
src++;
else
{
reg[RRR] = i;
i = (*src++ & 0x7F);
if (dimension == 1)
reg[rrr] = i;
else
reg[rrr] = ((i << 7) | (*src++ & 0x7F));
}
}
else if ((i == LEADING_CODE_PRIVATE_11)
|| (i == LEADING_CODE_PRIVATE_12))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment