diff options
author | Rob Landley <rob@landley.net> | 2017-02-20 22:40:10 -0600 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2017-02-20 22:40:10 -0600 |
commit | a36264ffcbe39d92ece08d05f204acd6085170bd (patch) | |
tree | 0ae95bfdcb9948c71520970eb6272032c33a1a7c /toys | |
parent | fd5687662c581b9f94a9076a3cd7436560682cf2 (diff) | |
download | toybox-a36264ffcbe39d92ece08d05f204acd6085170bd.tar.gz |
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.)
Diffstat (limited to 'toys')
-rw-r--r-- | toys/posix/ps.c | 5 |
1 files changed, 4 insertions, 1 deletions
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) { |