Date: Tue, 7 Mar 2017 04:51:35 +0000 (UTC) From: Conrad Meyer <cem@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r314832 - head/bin/ps Message-ID: <201703070451.v274pZl6052434@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201703070451.v274pZl6052434>