GNOME Bugzilla – Bug 415567
xmlXPathCmpNodes bug for attributes
Last modified: 2007-03-07 08:18:45 UTC
Please describe the problem: xpath.c(2832):xmlXPathCmpNodes(xmlNodePtr node1, xmlNodePtr node2) If node1==node2, and node1 is the first attribute of a node, the function returns -1 instead of 0. [code] cur = attrNode2->prev; while (cur != NULL) { if (cur == attrNode1) return (1); cur = cur->prev; } return (-1); [/code] As the attribute node is the first, cur is NULL, the loop exists, and the next instruction is return -1. Solution: Add something like if (node1 == node2) { return 0; } in the beginning of the procedure. Steps to reproduce: Actual results: Expected results: Does this happen every time? Other information:
Fixed in SVN - thanks!