svn commit: r336753 - head/usr.bin/top
Daichi GOTO
daichi at FreeBSD.org
Fri Jul 27 01:20:35 UTC 2018
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 at 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;
}
More information about the svn-src-head
mailing list