diff options
Diffstat (limited to 'filter')
-rw-r--r-- | filter/ChangeLog | 8 | ||||
-rw-r--r-- | filter/filter-file.c | 23 | ||||
-rw-r--r-- | filter/filter-source.c | 25 |
3 files changed, 36 insertions, 20 deletions
diff --git a/filter/ChangeLog b/filter/ChangeLog index a16abd676b..4fdd9b81e2 100644 --- a/filter/ChangeLog +++ b/filter/ChangeLog @@ -1,3 +1,11 @@ +2003-03-26 Jeffrey Stedfast <fejj@ximian.com> + + * filter-file.c (xml_decode): Loop over child nodes here too in + order to not be affected by libxml2 crack. + + * filter-source.c (xml_decode): Fixed to disreguard libxml2 crack. + (get_widget): Use strcmp instead of e_url_equal(). + 2003-03-20 Dan Winship <danw@ximian.com> * filter-datespec.c (timespans, set_button): Change the strings in diff --git a/filter/filter-file.c b/filter/filter-file.c index 265f0855dd..7d33e025d9 100644 --- a/filter/filter-file.c +++ b/filter/filter-file.c @@ -257,16 +257,21 @@ xml_decode (FilterElement *fe, xmlNodePtr node) file->type = type; n = node->children; - if (!strcmp (n->name, type)) { - str = xmlNodeGetContent (n); - if (str) - file->path = g_strdup (str); - else - file->path = g_strdup (""); + while (n != NULL) { + if (!strcmp (n->name, type)) { + str = xmlNodeGetContent (n); + if (str) + file->path = g_strdup (str); + else + file->path = g_strdup (""); + + d(printf (" '%s'\n", file->path)); + break; + } else if (n->type == XML_ELEMENT_NODE) { + g_warning ("Unknown node type '%s' encountered decoding a %s\n", n->name, type); + } - d(printf (" '%s'\n", file->path)); - } else if (n->type == XML_ELEMENT_NODE) { - g_warning ("Unknown node type '%s' encountered decoding a %s\n", n->name, type); + n = n->next; } return 0; diff --git a/filter/filter-source.c b/filter/filter-source.c index faa51e8f58..365403bdf2 100644 --- a/filter/filter-source.c +++ b/filter/filter-source.c @@ -195,14 +195,19 @@ xml_decode (FilterElement *fe, xmlNodePtr node) char *uri; node = node->children; - if (node && node->name && !strcmp (node->name, "uri")) { - uri = xmlNodeGetContent (node); - url = camel_url_new (uri, NULL); - xmlFree (uri); + while (node != NULL) { + if (!strcmp (node->name, "uri")) { + uri = xmlNodeGetContent (node); + url = camel_url_new (uri, NULL); + xmlFree (uri); + + g_free (fs->priv->current_url); + fs->priv->current_url = camel_url_to_string (url, CAMEL_URL_HIDE_ALL); + camel_url_free (url); + break; + } - g_free (fs->priv->current_url); - fs->priv->current_url = camel_url_to_string (url, CAMEL_URL_HIDE_ALL); - camel_url_free (url); + node = node->next; } return 0; @@ -275,13 +280,11 @@ get_widget (FilterElement *fe) g_object_set_data ((GObject *) item, "source", info); g_signal_connect (item, "activate", G_CALLBACK (source_changed), fs); - gtk_menu_shell_append(GTK_MENU_SHELL(menu), item); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); gtk_widget_show (item); - /* FIXME: don't use e_url_equal */ - if (fs->priv->current_url && e_url_equal (info->url, fs->priv->current_url)) { + if (fs->priv->current_url && !strcmp (info->url, fs->priv->current_url)) current_index = index; - } index++; } |