/* Set designation state into CODING. */
#define DECODE_DESIGNATION(reg, dimension, chars, final_char) \
do { \
- int charset = ISO_CHARSET_TABLE (make_number (dimension), \
- make_number (chars), \
- make_number (final_char)); \
+ int charset; \
+ \
+ if (final_char < '0' || final_char >= 128) \
+ goto label_invalid_code; \
+ charset = ISO_CHARSET_TABLE (make_number (dimension), \
+ make_number (chars), \
+ make_number (final_char)); \
if (charset >= 0 \
&& (CODING_SPEC_ISO_REQUESTED_DESIGNATION (coding, charset) == reg \
|| coding->safe_charsets[charset])) \
int result;
if (src_bytes <= 0
+ && coding->type != coding_type_ccl
&& ! (coding->mode & CODING_MODE_LAST_BLOCK
&& CODING_REQUIRE_FLUSHING (coding)))
{
move_gap_both (from, from_byte);
SHRINK_CONVERSION_REGION (&from_byte, &to_byte, coding, NULL, encodep);
if (from_byte == to_byte
+ && coding->type != coding_type_ccl
&& ! (coding->mode & CODING_MODE_LAST_BLOCK
&& CODING_REQUIRE_FLUSHING (coding)))
{
continue;
}
if (len_byte <= 0)
- break;
+ {
+ if (coding->type != coding_type_ccl
+ || coding->mode & CODING_MODE_LAST_BLOCK)
+ break;
+ coding->mode |= CODING_MODE_LAST_BLOCK;
+ continue;
+ }
if (result == CODING_FINISH_INSUFFICIENT_SRC)
{
/* The source text ends in invalid codes. Let's just
prev_Z = Z;
val = call1 (coding->post_read_conversion, make_number (inserted));
CHECK_NUMBER (val, 0);
- inserted = Z - prev_Z;
+ inserted += Z - prev_Z;
}
if (orig_point >= from)