# HG changeset patch # User Gerd Moellmann # Date 998920242 0 # Node ID 64125d607a06262f6c60defba1bb6507fb5b01a6 # Parent 4459c45545d0a9631e52f679919a7601f1285678 Finsert_file_contents): Allocate, restore, and free composition data in the case of REPLACE not being nil. diff -r 4459c45545d0 -r 64125d607a06 src/fileio.c --- a/src/fileio.c Mon Aug 27 13:03:53 2001 +0000 +++ b/src/fileio.c Mon Aug 27 13:50:42 2001 +0000 @@ -4016,6 +4016,8 @@ /* 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 @@ 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;