projects
/
oweals
/
busybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d527588
)
top/ps: argv0:"gdm-session-worker [pam/gdm-password]" == comm:"gdm-session-wor"
author
Denys Vlasenko
<vda.linux@googlemail.com>
Tue, 2 Oct 2012 09:31:37 +0000
(11:31 +0200)
committer
Denys Vlasenko
<vda.linux@googlemail.com>
Tue, 2 Oct 2012 09:31:37 +0000
(11:31 +0200)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
libbb/procps.c
patch
|
blob
|
history
diff --git
a/libbb/procps.c
b/libbb/procps.c
index 295048c4660e476a43dfc77e464f4851e88b530d..b4557e797616510ceef61981a074eafc338378cb 100644
(file)
--- a/
libbb/procps.c
+++ b/
libbb/procps.c
@@
-583,6
+583,8
@@
void FAST_FUNC read_cmdline(char *buf, int col, unsigned pid, const char *comm)
buf[sz] = '\0';
while (--sz >= 0 && buf[sz] == '\0')
continue;
+ /* Prevent basename("process foo/bar") = "bar" */
+ strchrnul(buf, ' ')[0] = '\0';
base = bb_basename(buf); /* before we replace argv0's NUL with space */
while (sz >= 0) {
if ((unsigned char)(buf[sz]) < ' ')