| Index: third_party/libxml/src/xpath.c
|
| diff --git a/third_party/libxml/src/xpath.c b/third_party/libxml/src/xpath.c
|
| index 533c7b7cd3e796ea7a226c9899357fd77075c6ae..132930bbbe16f63911b1895c096529fcabe1b086 100644
|
| --- a/third_party/libxml/src/xpath.c
|
| +++ b/third_party/libxml/src/xpath.c
|
| @@ -361,14 +361,14 @@ turtle_comparison:
|
| /*
|
| * compute depth to root
|
| */
|
| - for (depth2 = 0, cur = node2;cur->parent != NULL;cur = cur->parent) {
|
| - if (cur == node1)
|
| + for (depth2 = 0, cur = node2; cur->parent != NULL; cur = cur->parent) {
|
| + if (cur->parent == node1)
|
| return(1);
|
| depth2++;
|
| }
|
| root = cur;
|
| - for (depth1 = 0, cur = node1;cur->parent != NULL;cur = cur->parent) {
|
| - if (cur == node2)
|
| + for (depth1 = 0, cur = node1; cur->parent != NULL; cur = cur->parent) {
|
| + if (cur->parent == node2)
|
| return(-1);
|
| depth1++;
|
| }
|
| @@ -7934,14 +7934,14 @@ xmlXPathNextDescendant(xmlXPathParserContextPtr ctxt, xmlNodePtr cur) {
|
| xmlNodePtr
|
| xmlXPathNextDescendantOrSelf(xmlXPathParserContextPtr ctxt, xmlNodePtr cur) {
|
| if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
|
| - if (cur == NULL) {
|
| - if (ctxt->context->node == NULL)
|
| - return(NULL);
|
| - if ((ctxt->context->node->type == XML_ATTRIBUTE_NODE) ||
|
| - (ctxt->context->node->type == XML_NAMESPACE_DECL))
|
| - return(NULL);
|
| + if (cur == NULL)
|
| return(ctxt->context->node);
|
| - }
|
| +
|
| + if (ctxt->context->node == NULL)
|
| + return(NULL);
|
| + if ((ctxt->context->node->type == XML_ATTRIBUTE_NODE) ||
|
| + (ctxt->context->node->type == XML_NAMESPACE_DECL))
|
| + return(NULL);
|
|
|
| return(xmlXPathNextDescendant(ctxt, cur));
|
| }
|
|
|