]> git.eshelyaron.com Git - emacs.git/commit
insert-file-contents file shrinkage in scanback
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 13 Jul 2025 17:55:14 +0000 (10:55 -0700)
committerEshel Yaron <me@eshelyaron.com>
Thu, 24 Jul 2025 08:49:04 +0000 (10:49 +0200)
commit7fca630411ef36553eaa3db23bcb1803dfa647bf
tree393956ce4695e205944de82d44db98f49c86b581
parentb36b12887dfa9757054bc2f3e7a43857f015c0c6
insert-file-contents file shrinkage in scanback

* src/fileio.c (emacs_full_read): New function.
(Fcopy_file, Finsert_file_contents): Use it.
(Finsert_file_contents): Check for partial reads when scanning
backwards through the file’s tail, as this indicates the file
shrank while we read it.  Also, use emacs_full_read in other
situations where it’s simpler and should be a bit faster.

(cherry picked from commit 55f41ca3aa8fe487d10730708a7396137a2c9d18)
src/fileio.c