From: Eli Zaretskii Date: Sun, 19 Jan 2025 12:20:18 +0000 (+0200) Subject: * src/fileio.c (Finsert_file_contents): Fix last change. X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=251bfe2718cad9f0b554830309ee90e2657de383;p=emacs.git * src/fileio.c (Finsert_file_contents): Fix last change. (cherry picked from commit f367b01f128223d3fc7c34985eccce744333fa8f) --- 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))