[gnome-builder] Fix running autotools targets with relative paths



commit b11330a3af3a4e2f971116a6cb04cb119af692c5
Author: Patrick Griffis <tingping tingping se>
Date:   Tue Aug 23 18:23:51 2016 -0400

    Fix running autotools targets with relative paths

 libide/runtimes/ide-runtime.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/libide/runtimes/ide-runtime.c b/libide/runtimes/ide-runtime.c
index a27948a..05cdfc9 100644
--- a/libide/runtimes/ide-runtime.c
+++ b/libide/runtimes/ide-runtime.c
@@ -179,6 +179,7 @@ ide_runtime_real_create_runner (IdeRuntime     *self,
   g_autoptr(GFile) bin = NULL;
   IdeContext *context;
   IdeRunner *runner;
+  gchar *slash;
 
   g_assert (IDE_IS_RUNTIME (self));
   g_assert (IDE_IS_BUILD_TARGET (build_target));
@@ -196,6 +197,14 @@ ide_runtime_real_create_runner (IdeRuntime     *self,
                 "name", &name,
                 NULL);
 
+  /* Targets might be relative in autotools */
+  if ((slash = strrchr (name, '/')))
+    {
+      gchar *tmp = g_strdup (slash + 1);
+      g_free (name);
+      name = tmp;
+    }
+
   bin = g_file_get_child (installdir, name);
   binpath = g_file_get_path (bin);
 


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