mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2024-11-24 07:20:37 +00:00
(encode_terminal_code): Handle raw 8-bit codes correctly.
This commit is contained in:
parent
2b9413932e
commit
c42869c47d
18
src/term.c
18
src/term.c
@ -858,13 +858,19 @@ encode_terminal_code (src, dst, src_len, dst_len, consumed)
|
||||
}
|
||||
|
||||
encode_coding (coding, buf, dst, len, dst_end - dst);
|
||||
if (coding->consumed < len)
|
||||
/* We get a carryover because the remaining output
|
||||
buffer is too short. We must break the loop here
|
||||
without increasing SRC so that the next call of
|
||||
this function start from the same glyph. */
|
||||
break;
|
||||
len -= coding->consumed;
|
||||
dst += coding->produced;
|
||||
if (len > 0)
|
||||
{
|
||||
if (len > dst_end - dst)
|
||||
/* The remaining output buffer is too short. We must
|
||||
break the loop here without increasing SRC so that
|
||||
the next call of this function start from the same
|
||||
glyph. */
|
||||
break;
|
||||
buf += len;
|
||||
while (len--) *dst++ = *buf++;
|
||||
}
|
||||
}
|
||||
src++;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user