[gnome-builder] runtime: use full path to target binary



commit ca48d93b2de0d761e73337291be224f89e93ed1f
Author: Christian Hergert <chergert redhat com>
Date:   Sat Dec 2 13:37:49 2017 -0800

    runtime: use full path to target binary
    
    Even if the binary path is not-relative using ../, we could still need to
    prepend the install-dir as it might not be in $PATH.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=791137

 src/libide/runtimes/ide-runtime.c |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)
---
diff --git a/src/libide/runtimes/ide-runtime.c b/src/libide/runtimes/ide-runtime.c
index 5feef70..7d538a4 100644
--- a/src/libide/runtimes/ide-runtime.c
+++ b/src/libide/runtimes/ide-runtime.c
@@ -169,7 +169,6 @@ ide_runtime_real_create_runner (IdeRuntime     *self,
   IdeRuntimePrivate *priv = ide_runtime_get_instance_private (self);
   g_autoptr(GFile) installdir = NULL;
   g_auto(GStrv) argv = NULL;
-  const gchar *slash;
   IdeContext *context;
   IdeRunner *runner;
 
@@ -192,12 +191,10 @@ ide_runtime_real_create_runner (IdeRuntime     *self,
     }
 
   /* Possibly translate relative paths for the binary */
-  if (argv != NULL &&
-      argv[0] != NULL &&
-      !g_path_is_absolute (argv[0]) &&
-      NULL != (slash = strchr (argv[0], '/')))
+  if (argv && argv[0] && !g_path_is_absolute (argv[0]))
     {
-      g_autofree gchar *copy = g_strdup (slash + 1);
+      const gchar *slash = strchr (argv[0], '/');
+      g_autofree gchar *copy = g_strdup (slash ? (slash + 1) : argv[0]);
 
       g_free (argv[0]);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]