]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix insert-file-contents file error regression
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 1 Nov 2019 06:31:17 +0000 (23:31 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Fri, 1 Nov 2019 06:32:05 +0000 (23:32 -0700)
Problem reported for dired-view-file (Bug#37950).
* src/fileio.c (Finsert_file_contents): When visiting,
signal an error if the file could not be opened for any reason,
rather than signaling an error only for nonexistent files, fixing
a bug introduced in 2019-09-16T03:17:43!eggert@cs.ucla.edu.

src/fileio.c

index a3121a26dadb2238309888ec6a04c90375536d61..01f8a04e5d977e6e09ac594d0dafd11992bb842a 100644 (file)
@@ -4806,10 +4806,9 @@ by calling `format-decode', which see.  */)
       unbind_to (count1, Qnil);
     }
 
-  if (!NILP (visit)
-      && current_buffer->modtime.tv_nsec == NONEXISTENT_MODTIME_NSECS)
+  if (!NILP (visit) && current_buffer->modtime.tv_nsec < 0)
     {
-      /* If visiting nonexistent file, return nil.  */
+      /* Signal an error if visiting a file that could not be opened.  */
       report_file_errno ("Opening input file", orig_filename, save_errno);
     }