mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-10-20 03:52:25 +03:00
tried to fix the problems reported in bug #126735 fixed again some problem
* python/libxml.py: tried to fix the problems reported in bug #126735 * xpath.c SAX2.c error.c parser.c valid.c include/libxml/xmlerror.h: fixed again some problem trying to use the structured error handlers, c.f. bug #126735 * result/VC/ElementValid: tiny change due to the fix Daniel
This commit is contained in:
15
xpath.c
15
xpath.c
@@ -271,9 +271,7 @@ xmlXPathPErrMemory(xmlXPathParserContextPtr ctxt, const char *extra)
|
||||
void
|
||||
xmlXPathErr(xmlXPathParserContextPtr ctxt, int error)
|
||||
{
|
||||
if (ctxt != NULL)
|
||||
ctxt->error = error;
|
||||
if ((ctxt == NULL) || (ctxt->context == NULL)) {
|
||||
if (ctxt == NULL) {
|
||||
__xmlRaiseError(NULL, NULL, NULL,
|
||||
NULL, NULL, XML_FROM_XPATH,
|
||||
error + XML_XPATH_EXPRESSION_OK - XPATH_EXPRESSION_OK,
|
||||
@@ -282,6 +280,17 @@ xmlXPathErr(xmlXPathParserContextPtr ctxt, int error)
|
||||
xmlXPathErrorMessages[error]);
|
||||
return;
|
||||
}
|
||||
ctxt->error = error;
|
||||
if (ctxt->context == NULL) {
|
||||
__xmlRaiseError(NULL, NULL, NULL,
|
||||
NULL, NULL, XML_FROM_XPATH,
|
||||
error + XML_XPATH_EXPRESSION_OK - XPATH_EXPRESSION_OK,
|
||||
XML_ERR_ERROR, NULL, 0,
|
||||
(const char *) ctxt->base, NULL, NULL,
|
||||
ctxt->cur - ctxt->base, 0,
|
||||
xmlXPathErrorMessages[error]);
|
||||
return;
|
||||
}
|
||||
ctxt->context->lastError.domain = XML_FROM_XPATH;
|
||||
ctxt->context->lastError.code = error + XML_XPATH_EXPRESSION_OK -
|
||||
XPATH_EXPRESSION_OK;
|
||||
|
Reference in New Issue
Block a user