]> git.eshelyaron.com Git - emacs.git/commitdiff
* src/fileio.c (Finsert_file_contents): Fix last change.
authorEli Zaretskii <eliz@gnu.org>
Sun, 19 Jan 2025 12:20:18 +0000 (14:20 +0200)
committerEshel Yaron <me@eshelyaron.com>
Mon, 20 Jan 2025 15:58:44 +0000 (16:58 +0100)
(cherry picked from commit f367b01f128223d3fc7c34985eccce744333fa8f)

src/fileio.c

index bf80d71ab5992fdf97b3b627a45480d4d806fbaf..9ab17497395c38015566c6ac684b77998f64b500 100644 (file)
@@ -4754,6 +4754,11 @@ by calling `format-decode', which see.  */)
     /* For a special file that is not seekable, all we can do is guess.  */
     total = READ_BUF_SIZE;
 
+  /* From here on, treat a file with zero size as not seekable.  This
+     causes us to read until we actually hit EOF.  */
+  if (regular && st.st_size == 0)
+    seekable = false;
+
   if (NILP (visit) && total > 0)
     {
       if (!NILP (BVAR (current_buffer, file_truename))