argv[0] should keep people happy!
This commit is contained in:
parent
aef6890de1
commit
34dd01fa40
13
w.c
13
w.c
@ -12,6 +12,7 @@
|
|||||||
#include "proc/procps.h"
|
#include "proc/procps.h"
|
||||||
#include "proc/output.h"
|
#include "proc/output.h"
|
||||||
#include "proc/sysinfo.h"
|
#include "proc/sysinfo.h"
|
||||||
|
#include "proc/escape.h"
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
@ -217,10 +218,14 @@ static void showinfo(utmp_t *u, int formtype, int maxcmd, int from) {
|
|||||||
}
|
}
|
||||||
fputs(" ", stdout);
|
fputs(" ", stdout);
|
||||||
if (likely(best)) {
|
if (likely(best)) {
|
||||||
if (best->cmdline)
|
char cmdbuf[512];
|
||||||
print_strlist(stdout, best->cmdline, maxcmd);
|
escape_command(cmdbuf, best, sizeof cmdbuf, maxcmd, ESC_ARGS);
|
||||||
else
|
fputs(cmdbuf,stdout);
|
||||||
printf("%*.*s", -maxcmd, maxcmd, best->cmd);
|
|
||||||
|
// if (best->cmdline)
|
||||||
|
// print_strlist(stdout, best->cmdline, maxcmd);
|
||||||
|
// else
|
||||||
|
// printf("%*.*s", -maxcmd, maxcmd, best->cmd);
|
||||||
} else {
|
} else {
|
||||||
printf("-");
|
printf("-");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user