From: Eli Zaretskii Date: Wed, 30 Aug 2023 14:16:59 +0000 (+0300) Subject: Fix revert-buffer when some decoding is involved X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=8650b3308dd83d6f87ed14562c7d55c8bfde3faf;p=emacs.git Fix revert-buffer when some decoding is involved * src/fileio.c (Finsert_file_contents): Fix the amount of text read from the file when reverting. (Bug#65609) --- diff --git a/src/fileio.c b/src/fileio.c index 23e1a83d8bf..8919e08e1fd 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -4805,7 +4805,7 @@ by calling `format-decode', which see. */) /* 'try' is reserved in some compilers (Microsoft C). */ ptrdiff_t trytry = min (gap_size, READ_BUF_SIZE); - if (!NILP (end)) + if (seekable || !NILP (end)) trytry = min (trytry, total - inserted); if (!seekable && NILP (end))