]> git.eshelyaron.com Git - emacs.git/commitdiff
insert-file-contents byte vs char confusion
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 13 Jul 2025 00:21:35 +0000 (17:21 -0700)
committerEshel Yaron <me@eshelyaron.com>
Thu, 24 Jul 2025 08:48:56 +0000 (10:48 +0200)
* src/fileio.c (Finsert_file_contents): Use del_range_byte,
not del_range_1, since we are passing byte counts, not
character counts.  Problem reported by Pip Cet (Bug#77315).

(cherry picked from commit 4c4f68be4b7506502c6a4b133b02bb34f097496d)

src/fileio.c

index d7dd03db17e1f0ba68578bd238f325b2aeb1f3d4..70433f4d3304450d0993c08c1832cedf607b8070 100644 (file)
@@ -4440,7 +4440,7 @@ by calling `format-decode', which see.  */)
              clear_unwind_protect (fd_index);
 
              /* Truncate the buffer to the size of the file.  */
-             del_range_1 (same_at_start, same_at_end, 0, 0);
+             del_range_byte (same_at_start, same_at_end);
              goto handled;
            }