# HG changeset patch # User Karl Heuer # Date 769991447 0 # Node ID aba3ffcc8f51f25e2b27ffcd367f63a0fd7a5c0b # Parent 92a4522c37fcdf00b706d22d1bcabfd6d22fc19b (Finsert_file_contents): Check for beginning of file. diff -r 92a4522c37fc -r aba3ffcc8f51 src/fileio.c --- a/src/fileio.c Thu May 26 22:15:23 1994 +0000 +++ b/src/fileio.c Thu May 26 22:30:47 1994 +0000 @@ -2712,6 +2712,9 @@ /* 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)