diff options
| author | Paul Eggert | 2019-10-31 23:31:17 -0700 |
|---|---|---|
| committer | Paul Eggert | 2019-10-31 23:32:05 -0700 |
| commit | 3a1e7624ed234bb434cdafed59515cadd037cafa (patch) | |
| tree | 199aa665b1e9fa7e83d2f219e18dafeeff9d152f /src | |
| parent | 9d209c90345df6c39310912ba04ca02473a24bed (diff) | |
| download | emacs-3a1e7624ed234bb434cdafed59515cadd037cafa.tar.gz emacs-3a1e7624ed234bb434cdafed59515cadd037cafa.zip | |
Fix insert-file-contents file error regression
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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/fileio.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/fileio.c b/src/fileio.c index a3121a26dad..01f8a04e5d9 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -4806,10 +4806,9 @@ by calling `format-decode', which see. */) | |||
| 4806 | unbind_to (count1, Qnil); | 4806 | unbind_to (count1, Qnil); |
| 4807 | } | 4807 | } |
| 4808 | 4808 | ||
| 4809 | if (!NILP (visit) | 4809 | if (!NILP (visit) && current_buffer->modtime.tv_nsec < 0) |
| 4810 | && current_buffer->modtime.tv_nsec == NONEXISTENT_MODTIME_NSECS) | ||
| 4811 | { | 4810 | { |
| 4812 | /* If visiting nonexistent file, return nil. */ | 4811 | /* Signal an error if visiting a file that could not be opened. */ |
| 4813 | report_file_errno ("Opening input file", orig_filename, save_errno); | 4812 | report_file_errno ("Opening input file", orig_filename, save_errno); |
| 4814 | } | 4813 | } |
| 4815 | 4814 | ||