]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix crash with insert-file-contents and misdecoded text.
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 26 Jan 2014 00:32:30 +0000 (16:32 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Sun, 26 Jan 2014 00:32:30 +0000 (16:32 -0800)
* fileio.c (Finsert_file_contents): Set CODING_MODE_LAST_BLOCK
before invoking decode_coding_gap, since there's just one block.

Fixes: debbugs:16286
src/ChangeLog
src/fileio.c

index 7ed097976a14bd893e0619ac020af8795786681a..e875bc8a40d27d19ddf5254dc67bd1dfab8b1e3d 100644 (file)
@@ -1,3 +1,9 @@
+2014-01-26  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Fix crash with insert-file-contents and misdecoded text (Bug#16286).
+       * fileio.c (Finsert_file_contents): Set CODING_MODE_LAST_BLOCK
+       before invoking decode_coding_gap, since there's just one block.
+
 2014-01-25  Martin Rudalics  <rudalics@gmx.at>
 
        Fix handling of face attributes in Fx_create_frame (Bug#16529).
index d03a2bcf02f9c1a793d2b6a089097c20c23f4977..22db4602249ba39ff0b2b3c2dcd39699e98991fd 100644 (file)
@@ -4298,6 +4298,7 @@ by calling `format-decode', which see.  */)
       Z_BYTE -= inserted;
       ZV -= inserted;
       Z -= inserted;
+      coding.mode |= CODING_MODE_LAST_BLOCK;
       decode_coding_gap (&coding, inserted, inserted);
       inserted = coding.produced_char;
       coding_system = CODING_ID_NAME (coding.id);