]> git.eshelyaron.com Git - emacs.git/commitdiff
(Finsert_file_contents): Check for beginning of file.
authorKarl Heuer <kwzh@gnu.org>
Thu, 26 May 1994 22:30:47 +0000 (22:30 +0000)
committerKarl Heuer <kwzh@gnu.org>
Thu, 26 May 1994 22:30:47 +0000 (22:30 +0000)
src/fileio.c

index 79bd39161af580c0db2e16dd624d333df598e85d..e1131ce88606daa21b79c49bd94c5aa9537b785c 100644 (file)
@@ -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)