summaryrefslogtreecommitdiff
path: root/bin/ps
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2005-07-06 21:41:25 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2005-07-06 21:41:25 +0000
commit1d88ff536489142b0378dd26789d5ec692ec36fb (patch)
tree7ca8436004e99963a9bd42c1ae03383ef8def0b9 /bin/ps
parent3ff7faa34b687e0b0c4a63567d9e22f395b34e3c (diff)
Only print a space separating argv and the real command (in parens)
when argv is non-NULL and empty. OK deraadt@ and fgsch@.
Diffstat (limited to 'bin/ps')
-rw-r--r--bin/ps/print.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/bin/ps/print.c b/bin/ps/print.c
index 2b475ed820d..d718665a737 100644
--- a/bin/ps/print.c
+++ b/bin/ps/print.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print.c,v 1.37 2005/01/14 16:44:14 deraadt Exp $ */
+/* $OpenBSD: print.c,v 1.38 2005/07/06 21:41:24 millert 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.37 2005/01/14 16:44:14 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: print.c,v 1.38 2005/07/06 21:41:24 millert Exp $";
#endif
#endif /* not lint */
@@ -143,7 +143,8 @@ command(const struct kinfo_proc2 *kp, VARENT *ve)
}
if (argv == NULL || argv[0] == '\0' ||
strcmp(cmdpart(argv[0]), kp->p_comm)) {
- fmt_putc(' ', &left);
+ if (argv != NULL && argv[0] != '\0')
+ fmt_putc(' ', &left);
fmt_putc('(', &left);
fmt_puts(kp->p_comm, &left);
fmt_putc(')', &left);