netstar pushed a commit to branch master.

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

commit 88d1fe630dc6aec3ba0f27cf241eebdba5635871
Author: Alastair Poole <[email protected]>
Date:   Sat May 16 12:12:09 2020 +0100

    kvm: Reduce levels of indentation.
---
 src/bin/system/process.c | 25 +++++++++++--------------
 1 file changed, 11 insertions(+), 14 deletions(-)

diff --git a/src/bin/system/process.c b/src/bin/system/process.c
index 409660d..24b2be5 100644
--- a/src/bin/system/process.c
+++ b/src/bin/system/process.c
@@ -796,25 +796,22 @@ _cmd_get(Proc_Info *p, struct kinfo_proc *kp)
    Eina_Bool have_command = EINA_FALSE;
 
    kern = kvm_open(NULL, "/dev/null", NULL, O_RDONLY, "kvm_open");
-   if (kern != NULL)
+   if (kern)
      {
-        if ((args = kvm_getargv(kern, kp, sizeof(name)-1)))
+        if ((args = kvm_getargv(kern, kp, sizeof(name)-1)) && (args[0]))
           {
-             if (args[0])
+             char *base = strdup(args[0]);
+             if (base)
                {
-                  char *base = strdup(args[0]);
-                  if (base)
+                  char *spc = strchr(base, ' ');
+                  if (spc) *spc = '\0';
+
+                  if (ecore_file_exists(base))
                     {
-                       char *spc = strchr(base, ' ');
-                       if (spc) *spc = '\0';
-
-                       if (ecore_file_exists(base))
-                         {
-                            snprintf(name, sizeof(name), "%s", basename(base));
-                            have_command = EINA_TRUE;
-                         }
-                       free(base);
+                       snprintf(name, sizeof(name), "%s", basename(base));
+                       have_command = EINA_TRUE;
                     }
+                  free(base);
                }
              Eina_Strbuf *buf = eina_strbuf_new();
              for (int i = 0; args[i] != NULL; i++)

-- 


Reply via email to