From 1ddb09f51c247494d4b434fc603e5adda8b9aa7d Mon Sep 17 00:00:00 2001 From: Gerd Moellmann Date: Mon, 27 Aug 2001 13:50:42 +0000 Subject: [PATCH] Finsert_file_contents): Allocate, restore, and free composition data in the case of REPLACE not being nil. --- src/fileio.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/fileio.c b/src/fileio.c index 39850dcc45c..f5aeaee7a03 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -4016,6 +4016,8 @@ actually used.") /* Convert this batch with results in CONVERSION_BUFFER. */ if (how_much >= total) /* This is the last block. */ coding.mode |= CODING_MODE_LAST_BLOCK; + if (coding.composing != COMPOSITION_DISABLED) + coding_allocate_composition_data (&coding, BEGV); result = decode_coding (&coding, read_buf, conversion_buffer + inserted, this, bufsize - inserted); @@ -4124,6 +4126,10 @@ actually used.") SET_PT_BOTH (temp, same_at_start); insert_1 (conversion_buffer + same_at_start - BEG_BYTE, inserted, 0, 0, 0); + if (coding.cmp_data && coding.cmp_data->used) + coding_restore_composition (&coding, Fcurrent_buffer ()); + coding_free_composition_data (&coding); + /* Set `inserted' to the number of inserted characters. */ inserted = PT - temp; -- 2.39.5