changeset 7695:aba3ffcc8f51

(Finsert_file_contents): Check for beginning of file.
author Karl Heuer <kwzh@gnu.org>
date Thu, 26 May 1994 22:30:47 +0000
parents 92a4522c37fc
children ebcefadd2e1b
files src/fileio.c
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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)