fixing an XPath function evalutation bug pointed out by Alexey Efimov
* xpath.c: fixing an XPath function evalutation bug pointed out
by Alexey Efimov where the context was lost when evaluating
the function arguments
Daniel
diff --git a/xpath.c b/xpath.c
index 99c3d2e..7f1f87a 100644
--- a/xpath.c
+++ b/xpath.c
@@ -9861,11 +9861,17 @@
return (total);
}
case XPATH_OP_ARG:
+ bakd = ctxt->context->doc;
+ bak = ctxt->context->node;
if (op->ch1 != -1)
total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
+ ctxt->context->doc = bakd;
+ ctxt->context->node = bak;
CHECK_ERROR0;
if (op->ch2 != -1)
total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
+ ctxt->context->doc = bakd;
+ ctxt->context->node = bak;
CHECK_ERROR0;
return (total);
case XPATH_OP_PREDICATE: