From: Gerd Moellmann Date: Wed, 26 Sep 2001 15:30:07 +0000 (+0000) Subject: (Finsert_file_contents): If REPLACE is non-nil, stop X-Git-Tag: emacs-21.1~155 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=b02439c895f5c4c9b0e02ea273bbddd3285e934b;p=emacs.git (Finsert_file_contents): If REPLACE is non-nil, stop reading at EOF. --- diff --git a/src/ChangeLog b/src/ChangeLog index bf9f1ee228c..0ed1353ff76 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,8 @@ 2001-09-26 Gerd Moellmann + * 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. diff --git a/src/fileio.c b/src/fileio.c index 20b7079700e..b152f0a74e0 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -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;