]> git.eshelyaron.com Git - emacs.git/commit
Fix insert-file-contents infloop with unlucky END
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 20 Jul 2025 19:38:43 +0000 (12:38 -0700)
committerEshel Yaron <me@eshelyaron.com>
Fri, 25 Jul 2025 08:11:42 +0000 (10:11 +0200)
commit612356183dc27d8610d70762db370701565d33f1
tree0c24790311684ee9659f83141303b9f77059ac30
parent26034f34c7bf07a10755973e440fd02ddc966db2
Fix insert-file-contents infloop with unlucky END

This partially reverts 55f41ca3aa8fe487d10730708a7396137a2c9d18,
which was a partial fix for Bug#77315.
* src/fileio.c (Finsert_file_contents): Go back to accepting
partial reads when doing the optimized way when code conversion is
not needed.  This avoids an unlikely bug when END happens to lie
at a buffer boundary, causing an infloop.  For consistency, do the
same when doing code conversion (though there’s no bug in then),
as there’s not a real need for emacs_full_read there either.

(cherry picked from commit 27e0f0f79b9c97796fc89fedf3c05517532f0475)
src/fileio.c