summaryrefslogtreecommitdiffstats
path: root/bin/ps
diff options
context:
space:
mode:
authorgad <gad@FreeBSD.org>2004-06-23 12:18:36 +0000
committergad <gad@FreeBSD.org>2004-06-23 12:18:36 +0000
commitbf9f245cda47349b25ee02e943f872cdd230b842 (patch)
treee4f23619a4487e1abcd208449ac2f0af7acf2c0b /bin/ps
parent124619453d9830687c7c3ea9546afc1d026ad6db (diff)
downloadFreeBSD-src-bf9f245cda47349b25ee02e943f872cdd230b842.zip
FreeBSD-src-bf9f245cda47349b25ee02e943f872cdd230b842.tar.gz
Avoid padding the value of "ucomm" when it is the last column in the line.
Submitted by: Cyrille Lefevre
Diffstat (limited to 'bin/ps')
-rw-r--r--bin/ps/print.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/bin/ps/print.c b/bin/ps/print.c
index 0f2b14a..da8f2e0 100644
--- a/bin/ps/print.c
+++ b/bin/ps/print.c
@@ -180,7 +180,10 @@ ucomm(KINFO *k, VARENT *ve)
VAR *v;
v = ve->var;
- (void)printf("%-*s", v->width, k->ki_p->ki_comm);
+ if (ve->next == NULL) /* last field, don't pad */
+ (void)printf("%s", k->ki_p->ki_comm);
+ else
+ (void)printf("%-*s", v->width, k->ki_p->ki_comm);
}
void
OpenPOWER on IntegriCloud