From bf636265e06e47f6eb8273dac33111688af930e8 Mon Sep 17 00:00:00 2001 From: Chris Toshok Date: Wed, 26 Feb 2003 22:37:40 +0000 Subject: make this more robust - only assume it's a folderlistitem node if the name 2003-02-26 Chris Toshok * e-folder-list.c (e_folder_list_parse_xml): make this more robust - only assume it's a folderlistitem node if the name of the node is "folder". svn path=/trunk/; revision=20079 --- shell/ChangeLog | 6 ++++++ shell/e-folder-list.c | 11 +++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) (limited to 'shell') diff --git a/shell/ChangeLog b/shell/ChangeLog index b8ea1a0f27..942c4b2e93 100644 --- a/shell/ChangeLog +++ b/shell/ChangeLog @@ -1,3 +1,9 @@ +2003-02-26 Chris Toshok + + * e-folder-list.c (e_folder_list_parse_xml): make this more robust + - only assume it's a folderlistitem node if the name of the node + is "folder". + 2003-02-26 Jeffrey Stedfast * e-config-upgrade.c: Change the type of load_http_images to INT diff --git a/shell/e-folder-list.c b/shell/e-folder-list.c index 6b7ee32c93..fff4d6c4aa 100644 --- a/shell/e-folder-list.c +++ b/shell/e-folder-list.c @@ -490,10 +490,13 @@ e_folder_list_parse_xml (char *xml) items = g_new (EFolderListItem, i + 1); - for (node = root->xmlChildrenNode, i = 0; node; node = node->next, i++) { - items[i].uri = e_xml_get_string_prop_by_name_with_default (node, "uri", ""); - items[i].physical_uri = e_xml_get_string_prop_by_name_with_default (node, "physical-uri", ""); - items[i].display_name = e_xml_get_string_prop_by_name_with_default (node, "display-name", ""); + for (node = root->xmlChildrenNode, i = 0; node; node = node->next) { + if (node->name && !strcmp (node->name, "folder")) { + items[i].uri = e_xml_get_string_prop_by_name_with_default (node, "uri", ""); + items[i].physical_uri = e_xml_get_string_prop_by_name_with_default (node, "physical-uri", ""); + items[i].display_name = e_xml_get_string_prop_by_name_with_default (node, "display-name", ""); + i++; + } } items[i].uri = NULL; items[i].physical_uri = NULL; -- cgit v1.2.3