aboutsummaryrefslogtreecommitdiff
path: root/toys
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2016-10-08 17:30:50 -0500
committerRob Landley <rob@landley.net>2016-10-08 17:30:50 -0500
commit75ebbd1571c85a06c0f4767beb7c20a19068f0b6 (patch)
tree538e41ec968b1f0d66ff7920bd560ff47b5f5d31 /toys
parent6928fbc3a11c862a576433f17c73a2133a8c7d26 (diff)
downloadtoybox-75ebbd1571c85a06c0f4767beb7c20a19068f0b6.tar.gz
Teach ps -w not to truncate any fields.
Diffstat (limited to 'toys')
-rw-r--r--toys/posix/ps.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/toys/posix/ps.c b/toys/posix/ps.c
index 7a8327f3..cb57ecf2 100644
--- a/toys/posix/ps.c
+++ b/toys/posix/ps.c
@@ -566,7 +566,7 @@ static void show_ps(struct carveup *tb)
abslen = abs(field->len);
sign = field->len<0 ? -1 : 1;
olen = strlen(out);
- if (field->which<=PS_BIT && olen>abslen) {
+ if ((field->which<=PS_BIT || (toys.optflags&FLAG_w)) && olen>abslen) {
// overflow but remember by how much
extra += olen-abslen;
abslen = olen;