]> git.eshelyaron.com Git - emacs.git/commit
insert-file-contents respect END better
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 21 Jul 2025 22:10:56 +0000 (15:10 -0700)
committerEshel Yaron <me@eshelyaron.com>
Fri, 25 Jul 2025 08:11:53 +0000 (10:11 +0200)
commit20dfc82d2deb0edc8b559c93a9001ac7d608303f
tree0b3024d6e921439de7c2cd9940b89495c55ff808
parent850c271a48a9227c3b743987b745bf46a232c966
insert-file-contents respect END better

This fixes some longstanding bugs, along with bugs recently
introduced as part of fixes for Bug#77315.
* src/fileio.c (Finsert_file_contents): Arrange for END_OFFSET
to never be less than BEG_OFFSET, to simplify the code.
Do not go past END_OFFSET when sampling or optimizing reading.
Avoid a few unnecessary lseeks.

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