[gnome-builder] subprocess-launcher: fix pop_argv() to fetch proper	argument
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc: 
- Subject: [gnome-builder] subprocess-launcher: fix pop_argv() to fetch proper	argument
- Date: Fri, 28 Oct 2016 23:44:39 +0000 (UTC)
commit 3b3e4a404cee67807dce3c744ff825e68656b20c
Author: Christian Hergert <chergert redhat com>
Date:   Fri Oct 28 16:44:25 2016 -0700
    subprocess-launcher: fix pop_argv() to fetch proper argument
    
    We were returning the NULL, not the last string argument.
 libide/subprocess/ide-subprocess-launcher.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/libide/subprocess/ide-subprocess-launcher.c b/libide/subprocess/ide-subprocess-launcher.c
index b5ceb51..b6ddd6c 100644
--- a/libide/subprocess/ide-subprocess-launcher.c
+++ b/libide/subprocess/ide-subprocess-launcher.c
@@ -761,10 +761,12 @@ ide_subprocess_launcher_pop_argv (IdeSubprocessLauncher *self)
 
   g_return_val_if_fail (IDE_IS_SUBPROCESS_LAUNCHER (self), NULL);
 
-  if (priv->argv->len > 0)
+  if (priv->argv->len > 1)
     {
-      ret = g_ptr_array_index (priv->argv, priv->argv->len - 1);
-      g_ptr_array_index (priv->argv, priv->argv->len - 1) = NULL;
+      g_assert (g_ptr_array_index (priv->argv, priv->argv->len - 1) == NULL);
+
+      ret = g_ptr_array_index (priv->argv, priv->argv->len - 2);
+      g_ptr_array_index (priv->argv, priv->argv->len - 2) = NULL;
       g_ptr_array_set_size (priv->argv, priv->argv->len - 1);
     }
 
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]