real fix for bug #78858
diff --git a/ChangeLog b/ChangeLog
index 11f291b..a08ddc9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
+Tue 07 May 2002 09:20:21 AM PDT Aleksey Sanin <aleksey@aleksey.com>
+ * xpath.c: fixed bug #78858 (the real fix)
+
Sat 04 May 2002 11:56:31 PM PDT Aleksey Sanin <aleksey@aleksey.com>
- * xpath.c: fixed bug #78858
+ * xpath.c: fixed bug #78858 (quick and durty fix to hide the problem)
Sun May 5 08:57:08 CEST 2002 Daniel Veillard <daniel@veillard.com>
diff --git a/xpath.c b/xpath.c
index 8262e1d..b6daee6 100644
--- a/xpath.c
+++ b/xpath.c
@@ -7394,6 +7394,7 @@
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 @@
NEXT;
SKIP_BLANKS;
xmlXPathCompileExpr(ctxt);
+ CHECK_ERROR;
if (CUR != ')') {
XP_ERROR(XPATH_EXPR_ERROR);
}
@@ -10335,8 +10337,14 @@
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 @@
void
xmlXPathEvalExpr(xmlXPathParserContextPtr ctxt) {
xmlXPathCompileExpr(ctxt);
+ CHECK_ERROR;
xmlXPathRunEval(ctxt);
}