Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 27 Jul 2018 01:20:34 +0000 (UTC)
From:      Daichi GOTO <daichi@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r336753 - head/usr.bin/top
Message-ID:  <201807270120.w6R1KYmu085019@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: daichi
Date: Fri Jul 27 01:20:34 2018
New Revision: 336753
URL: https://svnweb.freebsd.org/changeset/base/336753

Log:
  top(1): fixed the empty output problem in non-interactive mode (-n, -b) regressed in r336028
  
  PR:		229842
  Reported by:	Ali Abdallah <aliovx@gmail.com>
  Reviewed by:	eadler, cy
  Approved by:	gnn (mentor)
  Differential Revision:	https://reviews.freebsd.org/D16455

Modified:
  head/usr.bin/top/screen.c

Modified: head/usr.bin/top/screen.c
==============================================================================
--- head/usr.bin/top/screen.c	Thu Jul 26 22:55:51 2018	(r336752)
+++ head/usr.bin/top/screen.c	Fri Jul 27 01:20:34 2018	(r336753)
@@ -54,6 +54,8 @@ static struct termios old_settings;
 static struct termios new_settings;
 static char is_a_terminal = false;
 
+#define NON_INTERACTIVE_MODE_VIRTUAL_SCREEN_WIDTH 1024
+
 void
 init_termcap(bool interactive)
 {
@@ -68,6 +70,7 @@ init_termcap(bool interactive)
     if (!interactive)
     {
 	/* pretend we have a dumb terminal */
+	screen_width = NON_INTERACTIVE_MODE_VIRTUAL_SCREEN_WIDTH;
 	smart_terminal = false;
 	return;
     }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201807270120.w6R1KYmu085019>