Fixed the code to build a list from keys of a hashtable
authorThadeu Lima de Souza Cascardo <cascardo@dcc.ufmg.br>
Thu, 29 Sep 2005 03:02:48 +0000 (03:02 +0000)
committerThadeu Lima de Souza Cascardo <cascardo@dcc.ufmg.br>
Thu, 29 Sep 2005 03:02:48 +0000 (03:02 +0000)
Fixed the code that built a list from the keys of a hash table.

git-archimport-id: cascardo@tlscascardo--private/libgrammatic--dev--0.1--patch-9

first.c

diff --git a/first.c b/first.c
index febcc2e..034e15a 100644 (file)
--- a/first.c
+++ b/first.c
@@ -477,8 +477,8 @@ GHashTable* grammar_first (Grammar* grammar)
 void put_key_on_list (gpointer key, gpointer val, gpointer data)
 {
   GList** l;
 void put_key_on_list (gpointer key, gpointer val, gpointer data)
 {
   GList** l;
-  l = (GList**) l;
-  *l = g_list_prepend (*l, key);
+  l = (GList**) data;
+  *l = g_list_prepend (*l, symbol_copy (key));
 }
 
 GList* first_get (GHashTable* first, symbol_t* symbol)
 }
 
 GList* first_get (GHashTable* first, symbol_t* symbol)