From a36264ffcbe39d92ece08d05f204acd6085170bd Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Mon, 20 Feb 2017 22:40:10 -0600 Subject: If the last ps field is left justified, it extends to the width of the screen. (Recent "show + for last char when truncated" change broke that, putting it back.) --- toys/posix/ps.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'toys/posix/ps.c') diff --git a/toys/posix/ps.c b/toys/posix/ps.c index bcf1e714..41ddf6a4 100644 --- a/toys/posix/ps.c +++ b/toys/posix/ps.c @@ -585,7 +585,10 @@ static void show_ps(void *p) pad *= sign; // If last field is left justified, no trailing spaces. - if (!field->next && sign<0) pad = -1; + if (!field->next && sign<0) { + pad = -1; + len = width; + } // If we truncated a left-justified field, show + instead of last char if (olen>len && len>1 && sign<0) { -- cgit v1.2.3