]> git.eshelyaron.com Git - emacs.git/commitdiff
Non-nil orig_filename in insert-file-contents
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 12 Jul 2025 19:06:09 +0000 (12:06 -0700)
committerEshel Yaron <me@eshelyaron.com>
Thu, 24 Jul 2025 08:47:35 +0000 (10:47 +0200)
* src/fileio.c (Finsert_file_contents): Don’t let orig_filename be
nil, as that might mess up later diagnostics.

(cherry picked from commit b1ada33b5dfac62258e9e3cb957dbe722b7c8990)

src/fileio.c

index 5d383a7b44dc6d3d129c18a880df51d2019e98ce..24efff21e4c3749d2f422f5f61b8b4543a013fbd 100644 (file)
@@ -4100,11 +4100,11 @@ by calling `format-decode', which see.  */)
 
   val = Qnil;
   p = Qnil;
-  orig_filename = Qnil;
   old_undo = Qnil;
 
   CHECK_STRING (filename);
   filename = Fexpand_file_name (filename, Qnil);
+  orig_filename = filename;
 
   /* The value Qnil means that the coding system is not yet
      decided.  */
@@ -4134,7 +4134,6 @@ by calling `format-decode', which see.  */)
   off_t beg_offset = !NILP (beg) ? file_offset (beg) : 0;
   off_t end_offset = !NILP (end) ? file_offset (end) : -1;
 
-  orig_filename = filename;
   filename = ENCODE_FILE (filename);
 
   /* A hint about the file size, or -1 if there is no hint.  */