1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-07-28 00:21:53 +03:00

real fix for bug #78858

This commit is contained in:
Aleksey Sanin
2002-05-07 16:21:36 +00:00
parent 29b6f76c53
commit 50fe8b1732
2 changed files with 14 additions and 2 deletions

11
xpath.c
View File

@ -7394,6 +7394,7 @@ xmlXPathCompFunctionCall(xmlXPathParserContextPtr ctxt) {
int op1 = ctxt->comp->last;
ctxt->comp->last = -1;
xmlXPathCompileExpr(ctxt);
CHECK_ERROR;
PUSH_BINARY_EXPR(XPATH_OP_ARG, op1, ctxt->comp->last, 0, 0);
nbargs++;
if (CUR == ')') break;
@ -7429,6 +7430,7 @@ xmlXPathCompPrimaryExpr(xmlXPathParserContextPtr ctxt) {
NEXT;
SKIP_BLANKS;
xmlXPathCompileExpr(ctxt);
CHECK_ERROR;
if (CUR != ')') {
XP_ERROR(XPATH_EXPR_ERROR);
}
@ -10335,8 +10337,14 @@ xmlXPathCompile(const xmlChar *str) {
ctxt = xmlXPathNewParserContext(str, NULL);
xmlXPathCompileExpr(ctxt);
if (*ctxt->cur != 0) {
/*
* aleksey: in some cases this line prints *second* error message
* (see bug #78858) and probably this should be fixed.
* However, we are not sure that all error messages are printed
* out in other places. It's not critical so we leave it as-is for now
*/
xmlXPatherror(ctxt, __FILE__, __LINE__, XPATH_EXPR_ERROR);
comp = NULL;
} else {
@ -10440,6 +10448,7 @@ xmlXPathCompiledEval(xmlXPathCompExprPtr comp, xmlXPathContextPtr ctx) {
void
xmlXPathEvalExpr(xmlXPathParserContextPtr ctxt) {
xmlXPathCompileExpr(ctxt);
CHECK_ERROR;
xmlXPathRunEval(ctxt);
}