diff options
| author | Kenichi Handa | 2021-03-27 14:38:56 +0900 |
|---|---|---|
| committer | Eli Zaretskii | 2021-03-27 10:42:25 +0300 |
| commit | b897bbc8135901c8edc24fc608a92d9deedeec60 (patch) | |
| tree | 9c713f1654eb0548ce1e72a66dce0ff188e2614f /src/coding.c | |
| parent | c2e72610d217f52d868c62102ff25e3279510e47 (diff) | |
| download | emacs-b897bbc8135901c8edc24fc608a92d9deedeec60.tar.gz emacs-b897bbc8135901c8edc24fc608a92d9deedeec60.zip | |
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)
Diffstat (limited to 'src/coding.c')
| -rw-r--r-- | src/coding.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/coding.c b/src/coding.c index 739dd6adcb5..46e7fca0f43 100644 --- a/src/coding.c +++ b/src/coding.c | |||
| @@ -7799,7 +7799,13 @@ encode_coding (struct coding_system *coding) | |||
| 7799 | coding_set_source (coding); | 7799 | coding_set_source (coding); |
| 7800 | consume_chars (coding, translation_table, max_lookup); | 7800 | consume_chars (coding, translation_table, max_lookup); |
| 7801 | coding_set_destination (coding); | 7801 | coding_set_destination (coding); |
| 7802 | /* The CODING_MODE_LAST_BLOCK flag should be set only for the last | ||
| 7803 | iteration of the encoding. */ | ||
| 7804 | unsigned saved_mode = coding->mode; | ||
| 7805 | if (coding->consumed_char < coding->src_chars) | ||
| 7806 | coding->mode &= ~CODING_MODE_LAST_BLOCK; | ||
| 7802 | (*(coding->encoder)) (coding); | 7807 | (*(coding->encoder)) (coding); |
| 7808 | coding->mode = saved_mode; | ||
| 7803 | } while (coding->consumed_char < coding->src_chars); | 7809 | } while (coding->consumed_char < coding->src_chars); |
| 7804 | 7810 | ||
| 7805 | if (BUFFERP (coding->dst_object) && coding->produced_char > 0) | 7811 | if (BUFFERP (coding->dst_object) && coding->produced_char > 0) |