From 251bfe2718cad9f0b554830309ee90e2657de383 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sun, 19 Jan 2025 14:20:18 +0200 Subject: [PATCH] * src/fileio.c (Finsert_file_contents): Fix last change. (cherry picked from commit f367b01f128223d3fc7c34985eccce744333fa8f) --- src/fileio.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/fileio.c b/src/fileio.c index bf80d71ab59..9ab17497395 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -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)) -- 2.39.5