]> git.eshelyaron.com Git - emacs.git/commit
insert-file-contents do not rely on st_size
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 12 Jul 2025 23:21:59 +0000 (16:21 -0700)
committerEshel Yaron <me@eshelyaron.com>
Thu, 24 Jul 2025 08:48:51 +0000 (10:48 +0200)
commitc29fe920aab5e1dde17d5a4d7896812c8c592ea0
tree3226041be90686ff651c2d51f3f1d8ba33f7c88b
parent2dd47c404208ed43a044e87843543ab35d32657e
insert-file-contents do not rely on st_size

This fix was prompted by Bug#77315.
* src/fileio.c (Finsert_file_contents): Do not rely on st_size for
anything other than a hint about the file size.  Trust only the
file size as revealed by a read that returns 0.

(cherry picked from commit e98da5cc3f394aef21b7ad3c46b104e057a8954b)
src/fileio.c