]> git.refcnt.org Git - colorize.git/commitdiff
main(): postpone invoking STACK_FILE(log)
authorSteven Schubiger <stsc@refcnt.org>
Wed, 30 Dec 2020 21:02:35 +0000 (22:02 +0100)
committerSteven Schubiger <stsc@refcnt.org>
Wed, 30 Dec 2020 21:02:35 +0000 (22:02 +0100)
colorize.c

index 38b2350c768f0ee7ca07053fdceca66b4f5c0dbf..9a6a6f9d69ac26e2ef023a007038ddfba6026ebe 100644 (file)
@@ -383,8 +383,12 @@ main (int argc, char **argv)
 
 #if DEBUG
     log = open_file (DEBUG_FILE, "w");
-    STACK_FILE (log);
     print_tstamp (log);
+    /* We're in debugging mode, hence we can't invoke STACK_FILE()
+       prior to print_tstamp(), because both cause text to be written
+       to the same logfile which is expected to have the timestamp
+       first.  */
+    STACK_FILE (log);
 #endif
 
     attr[0] = '\0';