diff options
author | Aaron Campbell <aaron@cvs.openbsd.org> | 2004-12-20 15:10:47 +0000 |
---|---|---|
committer | Aaron Campbell <aaron@cvs.openbsd.org> | 2004-12-20 15:10:47 +0000 |
commit | 5e53c0b4325e6ad20c08386ef7081d5c12f4d737 (patch) | |
tree | 7498b0b5dce0a66d967504bf4b954755cde0ec46 /bin/ps | |
parent | a672716e4a457ce72d12c9c7b534a229be647d74 (diff) |
Don't print an unnecessary trailing space character at the end of command
argument display. This makes it easier to grep ps output for 'foo$', instead
of having to use 'foo *$'. millert@ ok
Diffstat (limited to 'bin/ps')
-rw-r--r-- | bin/ps/print.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/bin/ps/print.c b/bin/ps/print.c index 7fc55cc570a..bf80103cabd 100644 --- a/bin/ps/print.c +++ b/bin/ps/print.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print.c,v 1.35 2004/11/24 19:17:10 deraadt Exp $ */ +/* $OpenBSD: print.c,v 1.36 2004/12/20 15:10:46 aaron Exp $ */ /* $NetBSD: print.c,v 1.27 1995/09/29 21:58:12 cgd Exp $ */ /*- @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)print.c 8.6 (Berkeley) 4/16/94"; #else -static char rcsid[] = "$OpenBSD: print.c,v 1.35 2004/11/24 19:17:10 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: print.c,v 1.36 2004/12/20 15:10:46 aaron Exp $"; #endif #endif /* not lint */ @@ -120,9 +120,10 @@ command(const struct kinfo_proc2 *kp, VARENT *ve) argv = kvm_getenvv2(kd, kp, termwidth); if ((p = argv) != NULL) { while (*p) { + if (p != argv) + fmt_putc(' ', &left); fmt_puts(*p, &left); p++; - fmt_putc(' ', &left); } } } else @@ -133,9 +134,10 @@ command(const struct kinfo_proc2 *kp, VARENT *ve) argv = kvm_getargv2(kd, kp, termwidth); if ((p = argv) != NULL) { while (*p) { + if (p != argv) + fmt_putc(' ', &left); fmt_puts(*p, &left); p++; - fmt_putc(' ', &left); } } } |