]> git.eshelyaron.com Git - emacs.git/commitdiff
insert-file-contents from seekable non-regular
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 20 Jul 2025 15:59:16 +0000 (08:59 -0700)
committerEshel Yaron <me@eshelyaron.com>
Fri, 25 Jul 2025 08:11:39 +0000 (10:11 +0200)
* src/fileio.c (Finsert_file_contents): Be more conservative
when reading from seekable non-regular files when END is given.
The code assumed that in this case, reads would succeed or fail
quickly so there was no need to call internal_condition_case_1.
However, in some cases, e.g., /dev/random, it could take a while.
This fixes a glitch introduced in commit
cb4579ed6ba45c81ee7ec627bf197e1def121f24 dated 2022-06-11.

(cherry picked from commit aaf9c5213f7102dca8da7b6aaf1d400419eda075)

src/fileio.c

index 010c5ac0864a70b138c94ea9210824cea7810200..9b47b565458fe8a721b9dff0e3438c917aedee58 100644 (file)
@@ -4897,7 +4897,7 @@ by calling `format-decode', which see.  */)
          }
        bufsize = min (bufsize, total - inserted);
 
-       if (!seekable && end_offset == TYPE_MAXIMUM (off_t))
+       if (!regular)
          {
            Lisp_Object nbytes;
            intmax_t number;