Avoid printing stdout and stderr messages without a newline between them.
authorEli Zaretskii <eliz@gnu.org>
Sat, 11 May 2013 14:42:56 +0000 (17:42 +0300)
committerEli Zaretskii <eliz@gnu.org>
Sat, 11 May 2013 14:42:56 +0000 (17:42 +0300)
 job.c (child_out): Output the newline following the message
 before fllush-ing the stream.  Avoids displaying the following
 failure message, which goes to stderr, on the same line.

ChangeLog
job.c

index 21e22ae..4d08576 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2013-05-11  Eli Zaretskii  <eliz@gnu.org>
+
+       * job.c (child_out): Output the newline following the message
+       before fllush-ing the stream.  Avoids displaying the following
+       failure message, which goes to stderr, on the same line.
+
 2013-05-06  Eli Zaretskii  <eliz@gnu.org>
 
        * gnumake.h (GMK_EXPORT) [_WIN32]: Move the dllexport declaration
diff --git a/job.c b/job.c
index daf3efe..106c518 100644 (file)
--- a/job.c
+++ b/job.c
@@ -503,8 +503,8 @@ child_out (const struct child *child, const char *msg, int out)
     {
       FILE *f = out ? stdout : stderr;
       fputs (msg, f);
-      fflush (f);
       putc ('\n', f);
+      fflush (f);
     }
 }