summaryrefslogtreecommitdiff
path: root/egg/egg-asn1x.c
diff options
context:
space:
mode:
authorStef Walter <stefw@collabora.co.uk>2010-12-13 18:58:43 +0000
committerStef Walter <stefw@collabora.co.uk>2010-12-13 18:58:43 +0000
commit8de6a97ebb06217dd1f7e76de897298ae12fb51f (patch)
tree05b86e53b6ccd98b346a7a6d8d516137446c4bde /egg/egg-asn1x.c
parent14526f568cb9acb177366792465bf8adcaf68956 (diff)
parentbae8a84bedd067dc04dadab53cc9eed63244dab8 (diff)
downloadgcr-8de6a97ebb06217dd1f7e76de897298ae12fb51f.tar.gz
Merge branch 'master' into trust-store
Diffstat (limited to 'egg/egg-asn1x.c')
-rw-r--r--egg/egg-asn1x.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/egg/egg-asn1x.c b/egg/egg-asn1x.c
index 7226c7c..23a23f0 100644
--- a/egg/egg-asn1x.c
+++ b/egg/egg-asn1x.c
@@ -3485,14 +3485,6 @@ compare_nodes_by_tag (gconstpointer a, gconstpointer b)
return (taga < tagb) ? -1 : 1;
}
-static void
-join_each_child (GNode *child, gpointer data)
-{
- GNode *node = data;
- g_node_unlink (child);
- g_node_append (node, child);
-}
-
static const ASN1_ARRAY_TYPE*
adef_next_sibling (const ASN1_ARRAY_TYPE *def)
{
@@ -3574,8 +3566,19 @@ traverse_and_prepare (GNode *node, gpointer data)
an->join = anj->def;
}
- if (join)
- g_node_children_foreach (join, G_TRAVERSE_ALL, join_each_child, node);
+ /* Move all the children of join node into our node */
+ if (join) {
+ list = NULL;
+ for (child = join->children, list = NULL; child; child = child->next)
+ list = g_list_prepend (list, child);
+ list = g_list_reverse (list);
+ for (l = list; l; l = g_list_next (l)) {
+ child = l->data;
+ g_node_unlink (child);
+ g_node_append (node, child);
+ }
+ g_list_free (list);
+ }
/* Lookup the max set size */
if (anode_def_type (node) == TYPE_SIZE) {
@@ -3599,7 +3602,7 @@ traverse_and_prepare (GNode *node, gpointer data)
for (l = an->opts; l; l = g_list_next (l))
anode_opt_add (node, l->data);
g_node_unlink (child);
- g_node_destroy (child);
+ anode_destroy (child);
}
child = next;
}