summaryrefslogtreecommitdiff
path: root/w.c
diff options
context:
space:
mode:
authoralbert <>2002-12-21 12:02:51 +0000
committeralbert <>2002-12-21 12:02:51 +0000
commit34dd01fa405bd06ac54aeaa6fa057689b81a9222 (patch)
tree6e66a846fc31e7e7d03636aa79374b33aa972ec8 /w.c
parentaef6890de1b939249000432022bf4a0e1c6d2d05 (diff)
downloadprocps-ng-34dd01fa405bd06ac54aeaa6fa057689b81a9222.tar.gz
argv[0] should keep people happy!
Diffstat (limited to 'w.c')
-rw-r--r--w.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/w.c b/w.c
index e9b0af5..4c6e7b4 100644
--- a/w.c
+++ b/w.c
@@ -12,6 +12,7 @@
#include "proc/procps.h"
#include "proc/output.h"
#include "proc/sysinfo.h"
+#include "proc/escape.h"
#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
@@ -217,10 +218,14 @@ static void showinfo(utmp_t *u, int formtype, int maxcmd, int from) {
}
fputs(" ", stdout);
if (likely(best)) {
- if (best->cmdline)
- print_strlist(stdout, best->cmdline, maxcmd);
- else
- printf("%*.*s", -maxcmd, maxcmd, best->cmd);
+ char cmdbuf[512];
+ escape_command(cmdbuf, best, sizeof cmdbuf, maxcmd, ESC_ARGS);
+ fputs(cmdbuf,stdout);
+
+// if (best->cmdline)
+// print_strlist(stdout, best->cmdline, maxcmd);
+// else
+// printf("%*.*s", -maxcmd, maxcmd, best->cmd);
} else {
printf("-");
}