For mod times farther in the future, print the value in fixed-point rather
authorPaul Smith <psmith@gnu.org>
Mon, 5 Nov 2007 14:15:19 +0000 (14:15 +0000)
committerPaul Smith <psmith@gnu.org>
Mon, 5 Nov 2007 14:15:19 +0000 (14:15 +0000)
than exponential notation (patch from Bruno Haible).

AUTHORS
ChangeLog
remake.c

diff --git a/AUTHORS b/AUTHORS
index e6b78da878b96d58eea3b9392290a58a8fd33bf9..647e5777ac9584de6f44131e5f6a219b63566365 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -60,6 +60,7 @@ Other contributors:
   Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
   Carl Staelin (Princeton University)
   Ian Stewartson (Data Logic Limited)
+  Ramon Garcia Fernandez <ramon.garcia.f@gmail.com>
 
 With suggestions/comments/bug reports from a cast of ... well ...
 hundreds, anyway :)
index 64cdae349bf4d439b16e4e67d853661c4e1e23d9..a99484f7bea03c173f10f68b4f3a4a2376911976 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,6 +6,11 @@
        * commands.c, file.c, job.c, remake.c, read.c, variable.c, main.c:
        Ditto.
 
+2007-10-27  Bruno Haible  <bruno@clisp.org>
+
+       * remake.c (f_mtime): Print time difference values between 100 and
+       ULONG_MAX in fixed-point notation rather than in exponention notation.
+
 2007-10-12  Eli Zaretskii  <eliz@gnu.org>
 
        * variable.c (do_variable_definition): Allow $(SHELL) to expand to
index 687b9d22ff61e155a5f875b01e5b68c500758d66..2dad3f01c96be7708a6c6384c7438731176f3f6c 100644 (file)
--- a/remake.c
+++ b/remake.c
@@ -1302,8 +1302,14 @@ f_mtime (struct file *file, int search)
                 (FILE_TIMESTAMP_S (mtime) - FILE_TIMESTAMP_S (now)
                  + ((FILE_TIMESTAMP_NS (mtime) - FILE_TIMESTAMP_NS (now))
                     / 1e9));
-              error (NILF, _("Warning: File `%s' has modification time %.2g s in the future"),
-                     file->name, from_now);
+              char from_now_string[100];
+
+              if (from_now >= 99 && from_now <= ULONG_MAX)
+                sprintf (from_now_string, "%lu", (unsigned long) from_now);
+              else
+                sprintf (from_now_string, "%.2g", from_now);
+              error (NILF, _("Warning: File `%s' has modification time %s s in the future"),
+                     file->name, from_now_string);
 #endif
               clock_skew_detected = 1;
             }