netstar pushed a commit to branch master.

http://git.enlightenment.org/apps/evisum.git/commit/?id=fc60c351ca4da69d567e94ade4c7ad6ff1d870db

commit fc60c351ca4da69d567e94ade4c7ad6ff1d870db
Author: Alastair Poole <nets...@gmail.com>
Date:   Sat May 9 00:00:56 2020 +0100

    process: Fix Linux Process Arguments.
    
    Arguments are NULL terminated until we hit padded NULLs.
---
 src/bin/process.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/src/bin/process.c b/src/bin/process.c
index f6987c1..72fedb3 100644
--- a/src/bin/process.c
+++ b/src/bin/process.c
@@ -184,9 +184,19 @@ _cmd_args(Proc_Info *p, int pid, char *name, size_t len)
           {
              if (fgets(line, sizeof(line), f))
                {
+                  Eina_Strbuf *buf = eina_strbuf_new();
+                  const char *n;
+
                   if (ecore_file_exists(line))
                     snprintf(name, len, "%s", ecore_file_file_get(line));
-                  p->arguments = strdup(line);
+
+                  n = line;
+                  while (*n && (*n + 1))
+                    {
+                       eina_strbuf_append_printf(buf, "%s ", n);
+                       n = strchr(n, '\0') + 1;
+                    }
+                  p->arguments = eina_strbuf_release(buf);
                }
              fclose(f);
           }

-- 


Reply via email to