]> granicus.if.org Git - procps-ng/commitdiff
top: restore the lost final newline when in Batch mode
authorJim Warner <james.warner@comcast.net>
Tue, 17 Sep 2013 05:00:00 +0000 (00:00 -0500)
committerJaromir Capik <jcapik@redhat.com>
Tue, 17 Sep 2013 18:27:02 +0000 (20:27 +0200)
This patch adds the final newline when exiting 'Batch'
mode. Interestingly, it has been missing since release
3.3.5 but undetected until the Redhat bugzilla report.

Reference(s):
https://bugzilla.redhat.com/show_bug.cgi?id=1008674

Signed-off-by: Jim Warner <james.warner@comcast.net>
top/top.c

index 6f4f7288eaf9696429780939376e8826c7e433be..44bc380547279cfdf3a9411e8374b69aeb3ef798 100644 (file)
--- a/top/top.c
+++ b/top/top.c
@@ -527,6 +527,7 @@ static void bye_bye (const char *str) {
       fputs(str, stderr);
       exit(EXIT_FAILURE);
    }
+   if (Batch) putp("\n");
    exit(EXIT_SUCCESS);
 } // end: bye_bye