From eb7e3af7edbdc6fc8e2053869a500eb1cf09ac08 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Fri, 15 Mar 2013 01:13:13 -0700 Subject: [PATCH] - client and wrapper (Linux): when parsing /proc/x/stat entries, handle command names that contains white space --- lib/procinfo_unix.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/procinfo_unix.cpp b/lib/procinfo_unix.cpp index 11d4ec7a9f..441a161397 100644 --- a/lib/procinfo_unix.cpp +++ b/lib/procinfo_unix.cpp @@ -104,7 +104,7 @@ struct PROC_STAT { int PROC_STAT::parse(char* buf) { int n = sscanf(buf, - "%d (%s %c %d %d %d %d %d " + "%d (%[^)]) %c %d %d %d %d %d " "%lu %lu %lu %lu %lu %lu %lu " "%d %d %d %d %d %d " "%lu %lu " @@ -152,8 +152,6 @@ int PROC_STAT::parse(char* buf) { &processor ); if (n == 39) { - char* p = strchr(comm, ')'); - if (p) *p = 0; return 0; }