From 226c1cb1dc86e8545c0f05886149a07c40a88162 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Mon, 29 Feb 2016 10:34:07 -0800 Subject: Fix trailing spaces on ps -o cmdline. --- toys/posix/ps.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'toys') diff --git a/toys/posix/ps.c b/toys/posix/ps.c index f99a2168..d2ef9fc1 100644 --- a/toys/posix/ps.c +++ b/toys/posix/ps.c @@ -673,7 +673,7 @@ static int get_ps(struct dirtree *new) len = sizeof(toybuf)-(buf-toybuf)-260-256*(ARRAY_LEN(fetch)-j); sprintf(buf, "%lld/%s", *slot, fetch[j].name); - // For cmdline we readlink instead of read contents + // For exe we readlink instead of read contents if (j==3) { if ((len = readlinkat(fd, buf, buf, len))>0) buf[len] = 0; else *buf = 0; @@ -735,7 +735,8 @@ static int get_ps(struct dirtree *new) if (buf[len-1]=='\n') buf[--len] = 0; // Turn NUL to space, other low ascii to ? (in non-tty mode) - for (i=0; i