if (EQ (eol_type, Qdos))
{
if (src == src_end)
- goto no_more_source;
+ {
+ coding->result = CODING_RESULT_INSUFFICIENT_SRC;
+ goto no_more_source;
+ }
if (*src == '\n')
ONE_MORE_BYTE (c);
}
if (EQ (eol_type, Qdos))
{
if (src == src_end)
- goto no_more_source;
+ {
+ coding->result = CODING_RESULT_INSUFFICIENT_SRC;
+ goto no_more_source;
+ }
if (*src == '\n')
ONE_MORE_BYTE (c);
}
ONE_MORE_BYTE (c1);
- /* We produce no character or one character. */
+ /* We produce at most one character. */
switch (iso_code_class [c1])
{
case ISO_0x20_or_0x7F:
if (EQ (eol_type, Qdos))
{
if (src == src_end)
- goto no_more_source;
+ {
+ coding->result = CODING_RESULT_INSUFFICIENT_SRC;
+ goto no_more_source;
+ }
if (*src == '\n')
ONE_MORE_BYTE (c1);
}
if (EQ (eol_type, Qdos))
{
if (src == src_end)
- goto no_more_source;
+ {
+ coding->result = CODING_RESULT_INSUFFICIENT_SRC;
+ goto no_more_source;
+ }
if (*src == '\n')
ONE_MORE_BYTE (c);
}
if (EQ (eol_type, Qdos))
{
if (src == src_end)
- goto no_more_source;
+ {
+ coding->result = CODING_RESULT_INSUFFICIENT_SRC;
+ goto no_more_source;
+ }
if (*src == '\n')
ONE_MORE_BYTE (c);
}
else. */
if (EQ (eol_type, Qdos))
{
- if (src < src_end
- && *src == '\n')
+ if (src == src_end)
+ {
+ coding->result = CODING_RESULT_INSUFFICIENT_SRC;
+ goto no_more_source;
+ }
+ if (*src == '\n')
ONE_MORE_BYTE (c);
}
else if (EQ (eol_type, Qmac))
{
if (EQ (eol_type, Qdos))
{
- if (src < src_end
- && *src == '\n')
+ if (src == src_end)
+ {
+ coding->result = CODING_RESULT_INSUFFICIENT_SRC;
+ goto no_more_source;
+ }
+ if (*src == '\n')
c = *src++;
}
else if (EQ (eol_type, Qmac))
/* Flush out unprocessed data as binary chars. We are sure
that the number of data is less than the size of
coding->charbuf. */
- int *charbuf = coding->charbuf;
-
while (nbytes-- > 0)
{
int c = *src++;
- *charbuf++ = (c & 0x80 ? - c : c);
+
+ coding->charbuf[coding->charbuf_used++] = (c & 0x80 ? - c : c);
}
produce_chars (coding);
}
coding->dst_pos = PT;
coding->dst_pos_byte = PT_BYTE;
coding->dst_multibyte = ! NILP (current_buffer->enable_multibyte_characters);
+ coding->mode |= CODING_MODE_LAST_BLOCK;
if (CODING_REQUIRE_DETECTION (coding))
detect_coding (coding);