Construct cookies treeview correctly (fixes 1675328)

svn path=/trunk/netsurf/; revision=3245
This commit is contained in:
John Mark Bell 2007-04-07 22:44:46 +00:00
parent 4aa1c867f5
commit 3bc2fdc652

View File

@ -145,9 +145,9 @@ bool cookies_update(const char *domain, const struct cookie_data *data)
node->expanded = expanded;
}
if (!data) {
if (!node)
return true;
tree_delete_node(cookies_tree, node, false);
if (!node)
return true;
tree_delete_node(cookies_tree, node, false);
tree_handle_node_changed(cookies_tree,
cookies_tree->root, true, false);
return true;
@ -157,16 +157,14 @@ bool cookies_update(const char *domain, const struct cookie_data *data)
if (!node) {
for (parent = cookies_tree->root->child; parent;
parent = parent->next) {
if (strcmp(domain, parent->data.text) < 0)
if (strcmp(domain, parent->data.text) == 0)
break;
}
if (!parent) {
node = tree_create_folder_node(cookies_tree->root,
domain);
} else {
node = tree_create_folder_node(NULL, domain);
if (node)
tree_link_node(parent, node, true);
node = parent;
}
}
if (!node)