]> git.eshelyaron.com Git - emacs.git/commit
insert-file-contents st_size cleanup
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 17 Jul 2025 16:50:07 +0000 (09:50 -0700)
committerEshel Yaron <me@eshelyaron.com>
Fri, 25 Jul 2025 08:11:30 +0000 (10:11 +0200)
commit0d043c60fbd99d76142dc345a61b89f92e8e338d
tree57d55c40a212aaa76dd20dfd7c474bd40fabf53e
parentb20a8244bdb648ccc8950050bc09dadefa8621da
insert-file-contents st_size cleanup

* src/fileio.c (Finsert_file_contents): Store st_size,
not file_size_hint, into current_buffer->modtime_size,
since modtime_size is compared to a later st_size, not
to the actual file size.  Simplify buffer overflow detection
from file size, since this occurred only on regular files.

(cherry picked from commit 8d83402edc96b5a88096ae707241f4e8cb59691b)
src/buffer.h
src/fileio.c