mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-11-24 07:19:37 +03:00
Construct cookies treeview correctly (fixes 1675328)
svn path=/trunk/netsurf/; revision=3245
This commit is contained in:
parent
4aa1c867f5
commit
3bc2fdc652
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user