]> git.eshelyaron.com Git - emacs.git/commitdiff
(Finsert_file_contents): If REPLACE is non-nil, stop
authorGerd Moellmann <gerd@gnu.org>
Wed, 26 Sep 2001 15:30:07 +0000 (15:30 +0000)
committerGerd Moellmann <gerd@gnu.org>
Wed, 26 Sep 2001 15:30:07 +0000 (15:30 +0000)
reading at EOF.

src/ChangeLog
src/fileio.c

index bf9f1ee228cb786d59e37bd41272a509b000b3c3..0ed1353ff76a99ba9da18cd7aa65a0926c4d68a2 100644 (file)
@@ -1,5 +1,8 @@
 2001-09-26  Gerd Moellmann  <gerd@gnu.org>
 
+       * fileio.c (Finsert_file_contents): If REPLACE is non-nil, stop
+       reading at EOF.
+
        * xdisp.c (with_echo_area_buffer): Use echo_kboard instead
        of the only temporarily set echoing flag for deciding when
        the cancel echoing.
index 20b7079700edcb7c9dd63088ce9f12829baff459..b152f0a74e086515cf29baa7c66fd108ede571e3 100644 (file)
@@ -3870,7 +3870,7 @@ actually used.")
            report_file_error ("Setting file position",
                               Fcons (orig_filename, Qnil));
 
-         total_read = 0;
+         total_read = nread = 0;
          while (total_read < trial)
            {
              nread = emacs_read (fd, buffer + total_read, trial - total_read);
@@ -3905,6 +3905,9 @@ actually used.")
                giveup_match_end = 1;
              break;
            }
+
+         if (nread == 0)
+           break;
        }
       immediate_quit = 0;