mirror of
https://github.com/rkd77/elinks.git
synced 2025-01-03 14:57:44 -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) {
|
switch (key->type) {
|
||||||
case DOM_NODE_ELEMENT:
|
case DOM_NODE_ELEMENT:
|
||||||
|
if (node->data.element.type)
|
||||||
return search->subtype - node->data.element.type;
|
return search->subtype - node->data.element.type;
|
||||||
|
break;
|
||||||
|
|
||||||
case DOM_NODE_ATTRIBUTE:
|
case DOM_NODE_ATTRIBUTE:
|
||||||
|
if (node->data.attribute.type)
|
||||||
return search->subtype - node->data.attribute.type;
|
return search->subtype - node->data.attribute.type;
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user