aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKarl Heuer1994-05-26 22:30:47 +0000
committerKarl Heuer1994-05-26 22:30:47 +0000
commitfc81fa9eafe18a1ab14e7b4010087c6f17516fe1 (patch)
tree1db027964a50f386fc7b3c13fff4bd5940fe1643 /src
parentc810639a783c483f6fce23d78f53bff4a162c7a3 (diff)
downloademacs-fc81fa9eafe18a1ab14e7b4010087c6f17516fe1.tar.gz
emacs-fc81fa9eafe18a1ab14e7b4010087c6f17516fe1.zip
(Finsert_file_contents): Check for beginning of file.
Diffstat (limited to 'src')
-rw-r--r--src/fileio.c3
1 files changed, 3 insertions, 0 deletions
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.")
2712 2712
2713 /* At what file position are we now scanning? */ 2713 /* At what file position are we now scanning? */
2714 curpos = st.st_size - (ZV - same_at_end); 2714 curpos = st.st_size - (ZV - same_at_end);
2715 /* If the entire file matches the buffer tail, stop the scan. */
2716 if (curpos == 0)
2717 break;
2715 /* How much can we scan in the next step? */ 2718 /* How much can we scan in the next step? */
2716 trial = min (curpos, sizeof buffer); 2719 trial = min (curpos, sizeof buffer);
2717 if (lseek (fd, curpos - trial, 0) < 0) 2720 if (lseek (fd, curpos - trial, 0) < 0)