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:
parent
ef32768d3a
commit
ef5d5fc27a
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user