1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

dom_node_cmp(): Only use element or attribute type ID if both are set

This commit is contained in:
Jonas Fonseca 2005-12-15 22:02:02 +01:00 committed by Jonas Fonseca
parent ef32768d3a
commit ef5d5fc27a

View File

@ -145,10 +145,14 @@ dom_node_cmp(struct dom_node_search *search, struct dom_node *node)
switch (key->type) {
case DOM_NODE_ELEMENT:
return search->subtype - node->data.element.type;
if (node->data.element.type)
return search->subtype - node->data.element.type;
break;
case DOM_NODE_ATTRIBUTE:
return search->subtype - node->data.attribute.type;
if (node->data.attribute.type)
return search->subtype - node->data.attribute.type;
break;
default:
break;