From owner-svn-src-head@freebsd.org Tue Mar 7 04:51:37 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 16F7DD0155F; Tue, 7 Mar 2017 04:51:37 +0000 (UTC) (envelope-from cem@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 mx1.freebsd.org (Postfix) with ESMTPS id DB0D21D71; Tue, 7 Mar 2017 04:51:36 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v274pZRU052435; Tue, 7 Mar 2017 04:51:35 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v274pZl6052434; Tue, 7 Mar 2017 04:51:35 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201703070451.v274pZl6052434@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Tue, 7 Mar 2017 04:51:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r314832 - head/bin/ps X-SVN-Group: head 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.23 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: Tue, 07 Mar 2017 04:51:37 -0000 Author: cem Date: Tue Mar 7 04:51:35 2017 New Revision: 314832 URL: https://svnweb.freebsd.org/changeset/base/314832 Log: ps(1): Fix -w + UNLIMITED handling A follow-up fix for r314685. Because the -w flag is parsed after ps(1) infers termwidth from COLUMNS and stdout, and UNLIMITED happens to be the zero value, the single -w flag in combination with a non-terminal stdout or COLUMNS=0 could result in output truncated at 131 characters. (Despite the output being unlimited without -w.) Obviously, adding more -w shouldn't truncate output lines. The committed patch is from bdrewery@, and I've reviewed and tested it. Submitted by: bdrewery@ Reported by: bdrewery@ Sponsored by: Dell EMC Isilon Modified: head/bin/ps/ps.c Modified: head/bin/ps/ps.c ============================================================================== --- head/bin/ps/ps.c Tue Mar 7 04:33:17 2017 (r314831) +++ head/bin/ps/ps.c Tue Mar 7 04:51:35 2017 (r314832) @@ -401,7 +401,7 @@ main(int argc, char *argv[]) case 'w': if (wflag) termwidth = UNLIMITED; - else if (termwidth < 131) + else if (termwidth < 131 && termwidth != UNLIMITED) termwidth = 131; wflag++; break;