From: Andreas Schwab Date: Tue, 3 Jul 2012 22:03:37 +0000 (+0200) Subject: * fileio.c (Finsert_file_contents): Properly handle st_mtime X-Git-Tag: emacs-24.2.90~1199^2~239 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=636334d6cc811d4194cd18ae6296ea65ccf72510;p=emacs.git * fileio.c (Finsert_file_contents): Properly handle st_mtime marker for non-existing file. --- diff --git a/src/ChangeLog b/src/ChangeLog index b1575f621e3..a82d2a03af8 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 942957030e0..820dabff53e 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; }