[gnome-builder] results: stash the pointer added to the string chunk



commit 09c40959f5ee779f7289a7674bdac9a4496c220e
Author: Christian Hergert <chergert redhat com>
Date:   Tue Jun 26 18:02:47 2018 -0700

    results: stash the pointer added to the string chunk

 src/plugins/c-pack/cpack-completion-results.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/src/plugins/c-pack/cpack-completion-results.c b/src/plugins/c-pack/cpack-completion-results.c
index b3b00883c..c1c0da77d 100644
--- a/src/plugins/c-pack/cpack-completion-results.c
+++ b/src/plugins/c-pack/cpack-completion-results.c
@@ -242,6 +242,8 @@ cpack_completion_results_populate_cb (GObject      *object,
           const gchar *name = g_file_info_get_name (info);
           const gchar *word;
 
+          g_assert (G_IS_FILE_INFO (info));
+
           if (name == NULL)
             continue;
 
@@ -253,7 +255,7 @@ cpack_completion_results_populate_cb (GObject      *object,
           if (!(word = g_hash_table_lookup (self->words, name)))
             {
               word = g_string_chunk_insert (self->strings, name);
-              g_hash_table_add (self->words, (gchar *)name);
+              g_hash_table_add (self->words, (gchar *)word);
               g_ptr_array_add (self->unfiltered, (gchar *)word);
             }
         }


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