From owner-svn-src-head@freebsd.org Fri Jul 27 01:20:35 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 16857105D1EC; Fri, 27 Jul 2018 01:20:35 +0000 (UTC) (envelope-from daichi@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BEBB67EA0A; Fri, 27 Jul 2018 01:20:34 +0000 (UTC) (envelope-from daichi@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9FF2811193; Fri, 27 Jul 2018 01:20:34 +0000 (UTC) (envelope-from daichi@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w6R1KY5p085020; Fri, 27 Jul 2018 01:20:34 GMT (envelope-from daichi@FreeBSD.org) Received: (from daichi@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w6R1KYmu085019; Fri, 27 Jul 2018 01:20:34 GMT (envelope-from daichi@FreeBSD.org) Message-Id: <201807270120.w6R1KYmu085019@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: daichi set sender to daichi@FreeBSD.org using -f From: Daichi GOTO Date: Fri, 27 Jul 2018 01:20:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336753 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: daichi X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 336753 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jul 2018 01:20:35 -0000 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 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; }