]> git.eshelyaron.com Git - emacs.git/commitdiff
Finsert_file_contents): Allocate, restore, and
authorGerd Moellmann <gerd@gnu.org>
Mon, 27 Aug 2001 13:50:42 +0000 (13:50 +0000)
committerGerd Moellmann <gerd@gnu.org>
Mon, 27 Aug 2001 13:50:42 +0000 (13:50 +0000)
free composition data in the case of REPLACE not being nil.

src/fileio.c

index 39850dcc45cf17884e40b62fa964b3bf8d96e651..f5aeaee7a03889245a14591054d929e932669892 100644 (file)
@@ -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;