From c112e15a7917fccca6b5c78977451ca2b9a23e97 Mon Sep 17 00:00:00 2001 From: Andrea Zagli Date: Wed, 7 Jul 2010 13:03:16 +0200 Subject: [PATCH] Bugfix on Autoz::load_from_xml. --- .gitignore | 1 + src/autoz.c | 18 +++++++++--------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index 2d297f1..d08e9f9 100644 --- a/.gitignore +++ b/.gitignore @@ -47,3 +47,4 @@ mkinstalldirs stamp-it intltool-* Rules-quot +*.exe diff --git a/src/autoz.c b/src/autoz.c index 13daaca..ea06b76 100644 --- a/src/autoz.c +++ b/src/autoz.c @@ -365,7 +365,7 @@ autoz_add_parents_to_resource (Autoz *autoz, AutozIResource *iresource, ...) } else { - resource_parent = g_hash_table_lookup (priv->roles, resource_id_parent); + resource_parent = g_hash_table_lookup (priv->resources, resource_id_parent); if (resource_parent != NULL) { resource->parents = g_list_append (resource->parents, resource_parent); @@ -944,13 +944,13 @@ autoz_load_from_xml (Autoz *autoz, xmlNodePtr xnode, gboolean replace) { if (!xmlNodeIsText (current_parent) && xmlStrcmp (current_parent->name, "parent") == 0) - { - prop = g_strstrip (g_strdup ((gchar *)xmlGetProp (current_parent, "id"))); - if (g_strcmp0 (prop, "") != 0) + { + prop = g_strstrip (g_strdup ((gchar *)xmlGetProp (current_parent, "id"))); + if (g_strcmp0 (prop, "") != 0) { autoz_add_parent_to_role (autoz, irole, autoz_get_role_from_id (autoz, prop)); } - } + } current_parent = current_parent->next; } } @@ -968,13 +968,13 @@ autoz_load_from_xml (Autoz *autoz, xmlNodePtr xnode, gboolean replace) { if (!xmlNodeIsText (current_parent) && xmlStrcmp (current_parent->name, "parent") == 0) - { - prop = g_strstrip (g_strdup ((gchar *)xmlGetProp (current_parent, "id"))); - if (g_strcmp0 (prop, "") != 0) + { + prop = g_strstrip (g_strdup ((gchar *)xmlGetProp (current_parent, "id"))); + if (g_strcmp0 (prop, "") != 0) { autoz_add_parent_to_resource (autoz, iresource, autoz_get_resource_from_id (autoz, prop)); } - } + } current_parent = current_parent->next; } } -- 2.49.0