1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-25 23:10:47 -08:00

Fix encoding by ISO-2022-JP

* src/coding.c (encode_coding): Reset the CODING_MODE_LAST_BLOCK
flag for all iterations but the last one.  (Bug#46933)
This commit is contained in:
Kenichi Handa 2021-03-27 14:38:56 +09:00 committed by Eli Zaretskii
parent c2e72610d2
commit b897bbc813

View file

@ -7799,7 +7799,13 @@ encode_coding (struct coding_system *coding)
coding_set_source (coding);
consume_chars (coding, translation_table, max_lookup);
coding_set_destination (coding);
/* The CODING_MODE_LAST_BLOCK flag should be set only for the last
iteration of the encoding. */
unsigned saved_mode = coding->mode;
if (coding->consumed_char < coding->src_chars)
coding->mode &= ~CODING_MODE_LAST_BLOCK;
(*(coding->encoder)) (coding);
coding->mode = saved_mode;
} while (coding->consumed_char < coding->src_chars);
if (BUFFERP (coding->dst_object) && coding->produced_char > 0)