Fix handling of hosts with no paths attached (fixes #1505891)

svn path=/trunk/netsurf/; revision=2620
This commit is contained in:
John Mark Bell 2006-06-15 15:06:59 +00:00
parent c1dbdad995
commit 026ba672ae

View File

@ -1136,7 +1136,11 @@ void urldb_iterate_partial(const char *prefix,
return; return;
} }
urldb_iterate_partial_path(&h->paths, slash + 1, callback); if (h->paths.children) {
/* Have paths, iterate them */
urldb_iterate_partial_path(&h->paths, slash + 1,
callback);
}
} else { } else {
int len = strlen(prefix); int len = strlen(prefix);
@ -1195,10 +1199,12 @@ bool urldb_iterate_partial_host(struct search_node *root, const char *prefix,
callback)) callback))
return false; return false;
/* and extract all paths attached to this host */ if (root->data->paths.children) {
if (!urldb_iterate_entries_path(&root->data->paths, /* and extract all paths attached to this host */
callback)) { if (!urldb_iterate_entries_path(&root->data->paths,
return false; callback)) {
return false;
}
} }
if (!urldb_iterate_partial_host(root->right, prefix, if (!urldb_iterate_partial_host(root->right, prefix,
@ -1294,8 +1300,12 @@ bool urldb_iterate_entries_host(struct search_node *parent,
if (!urldb_iterate_entries_host(parent->left, callback)) if (!urldb_iterate_entries_host(parent->left, callback))
return false; return false;
if (!urldb_iterate_entries_path(&parent->data->paths, callback)) { if (parent->data->paths.children) {
return false; /* We have paths, so iterate them */
if (!urldb_iterate_entries_path(&parent->data->paths,
callback)) {
return false;
}
} }
if (!urldb_iterate_entries_host(parent->right, callback)) if (!urldb_iterate_entries_host(parent->right, callback))