From: Paul Eggert Date: Mon, 6 Jun 2011 05:57:31 +0000 (-0700) Subject: * fileio.c (Fverify_visited_file_modtime): Avoid time overflow X-Git-Tag: emacs-pretest-24.0.90~104^2~618^2~10^2~5 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=7f9bbdbbd60a3c9052537cd4b65a3a6d959b7746;p=emacs.git * fileio.c (Fverify_visited_file_modtime): Avoid time overflow if b->modtime has its maximal value. --- diff --git a/src/ChangeLog b/src/ChangeLog index 4269bf4655b..f86b0decf3c 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,8 @@ 2011-06-06 Paul Eggert + * fileio.c (Fverify_visited_file_modtime): Avoid time overflow + if b->modtime has its maximal value. + * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits. Don't assume time_t can fit into int. diff --git a/src/fileio.c b/src/fileio.c index 94894b97a6e..48dac80a39f 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -4960,7 +4960,7 @@ See Info node `(elisp)Modification Time' for more details. */) if ((st.st_mtime == b->modtime /* If both are positive, accept them if they are off by one second. */ || (st.st_mtime > 0 && b->modtime > 0 - && (st.st_mtime == b->modtime + 1 + && (st.st_mtime - 1 == b->modtime || st.st_mtime == b->modtime - 1))) && (st.st_size == b->modtime_size || b->modtime_size < 0))