]> granicus.if.org Git - procps-ng/commitdiff
argv[0] should keep people happy!
authoralbert <>
Sat, 21 Dec 2002 12:02:51 +0000 (12:02 +0000)
committeralbert <>
Sat, 21 Dec 2002 12:02:51 +0000 (12:02 +0000)
w.c

diff --git a/w.c b/w.c
index e9b0af5e71a6a2021e12b4d0ab5c06b3a96b393e..4c6e7b453c9ef8785412699b068783edcdbb8f60 100644 (file)
--- 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("-");
     }