]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix revert-buffer when some decoding is involved
authorEli Zaretskii <eliz@gnu.org>
Wed, 30 Aug 2023 14:16:59 +0000 (17:16 +0300)
committerEli Zaretskii <eliz@gnu.org>
Wed, 30 Aug 2023 14:16:59 +0000 (17:16 +0300)
* src/fileio.c (Finsert_file_contents): Fix the amount of text
read from the file when reverting.  (Bug#65609)

src/fileio.c

index 23e1a83d8bf7150d3d27bb4067110e36dfefcea2..8919e08e1fd78f44dea2ec0449534b6d26034343 100644 (file)
@@ -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))