* lread.c (Fload): Don't compare a possibly-garbage time_t value.
[bpt/emacs.git] / src / lread.c
index 0426cd4..b789457 100644 (file)
@@ -1203,10 +1203,13 @@ Return t if the file exists and loads successfully.  */)
 #ifdef DOS_NT
          fmode = "rb";
 #endif /* DOS_NT */
-         stat (SSDATA (efound), &s1);
-         SSET (efound, SBYTES (efound) - 1, 0);
-         result = stat (SSDATA (efound), &s2);
-         SSET (efound, SBYTES (efound) - 1, 'c');
+         result = stat (SSDATA (efound), &s1);
+         if (result == 0)
+           {
+             SSET (efound, SBYTES (efound) - 1, 0);
+             result = stat (SSDATA (efound), &s2);
+             SSET (efound, SBYTES (efound) - 1, 'c');
+           }
 
          if (result == 0 && s1.st_mtime < s2.st_mtime)
            {