From 8e5ef348968f9cccef21f83b940c0ffad2ebe31d Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 13 Jul 2025 08:46:24 -0700 Subject: [PATCH] =?utf8?q?READ=5FBUF=5FSIZE=20=E2=86=92=20sizeof=20read=5F?= =?utf8?q?buf?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit * src/fileio.c (Finsert_file_contents): Minor refactoring. This should help future patches which distinguish read_buf’s size from other uses of READ_BUF_SIZE which may change. (cherry picked from commit ae30a61c74215c3e02fb3c0d603894457a4cfef5) --- src/fileio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fileio.c b/src/fileio.c index 7aa2113454b..4c3bc5787cf 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -4616,11 +4616,11 @@ by calling `format-decode', which see. */) while (true) { - /* Read at most READ_BUF_SIZE bytes at a time, to allow + /* Read one buffer a time, to allow quitting while reading a huge file. */ this = emacs_fd_read (fd, read_buf + unprocessed, - READ_BUF_SIZE - unprocessed); + sizeof read_buf - unprocessed); if (this <= 0) break; -- 2.39.5