[gnome-builder/wip/tingping/runner: 1/3] Fix running autotools targets with relative paths



commit 9bc570130e39df0900135fd64ab73dc2f3533172
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 b9fff8e..984e59e 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]