From fc81fa9eafe18a1ab14e7b4010087c6f17516fe1 Mon Sep 17 00:00:00 2001 From: Karl Heuer Date: Thu, 26 May 1994 22:30:47 +0000 Subject: [PATCH] (Finsert_file_contents): Check for beginning of file. --- src/fileio.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/fileio.c b/src/fileio.c index 79bd39161af..e1131ce8860 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -2712,6 +2712,9 @@ and (2) it puts less data in the undo list.") /* At what file position are we now scanning? */ curpos = st.st_size - (ZV - same_at_end); + /* If the entire file matches the buffer tail, stop the scan. */ + if (curpos == 0) + break; /* How much can we scan in the next step? */ trial = min (curpos, sizeof buffer); if (lseek (fd, curpos - trial, 0) < 0) -- 2.39.5