From 636334d6cc811d4194cd18ae6296ea65ccf72510 Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Wed, 4 Jul 2012 00:03:37 +0200 Subject: [PATCH] * fileio.c (Finsert_file_contents): Properly handle st_mtime marker for non-existing file. --- src/ChangeLog | 5 +++++ src/fileio.c | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index b1575f621e..a82d2a03af 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2012-07-03 Andreas Schwab + + * fileio.c (Finsert_file_contents): Properly handle st_mtime + marker for non-existing file. (Bug#11852) + 2012-07-03 Glenn Morris * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN diff --git a/src/fileio.c b/src/fileio.c index 942957030e..820dabff53 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -4193,7 +4193,10 @@ variable `last-coding-system-used' to the coding system actually used. */) if (NILP (handler)) { - current_buffer->modtime = get_stat_mtime (&st); + if (st.st_mtime == -1) + EMACS_SET_INVALID_TIME (current_buffer->modtime); + else + current_buffer->modtime = get_stat_mtime (&st); current_buffer->modtime_size = st.st_size; BVAR (current_buffer, filename) = orig_filename; } -- 2.39.2