]> git.eshelyaron.com Git - emacs.git/commitdiff
* fileio.c (Fverify_visited_file_modtime): Avoid time overflow
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 2 Jun 2011 06:23:20 +0000 (23:23 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 2 Jun 2011 06:23:20 +0000 (23:23 -0700)
if b->modtime has its maximal value.

src/ChangeLog
src/fileio.c

index 44c9db28d5896179b9f701932e8326fc3116f373..0d84500e78d949a0c12c61be4d45b3973852d07c 100644 (file)
@@ -1,5 +1,8 @@
 2011-06-02  Paul Eggert  <eggert@cs.ucla.edu>
 
+       * 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.
 
        * lisp.h: Include <intprops.h>, as it'll useful in later changes.
index 94894b97a6e226a267f563619ae761d665798920..48dac80a39f6c4811fb41ead67a7ceeed82e5a5e 100644 (file)
@@ -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))