1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2024-10-26 12:25:09 +03:00

Fix problem with specific and generic error handlers

It seems that setting up both xmlTextReaderSetStructuredErrorHandler and
xmlSetStructuredErrorFunc confuses the code around error.c:592 and following
This patch works with any combinations of using xmlSetStructuredErrorFunc,
xmlTextReaderSetStructuredErrorHandler, both, or none.
This commit is contained in:
Pietro Cerutti 2012-08-27 13:24:08 +08:00 committed by Daniel Veillard
parent 466fcdaa33
commit 890faa546b

View File

@ -615,8 +615,11 @@ __xmlRaiseError(xmlStructuredErrorFunc schannel,
data = ctxt->userData;
} else if (channel == NULL) {
channel = xmlGenericError;
if (!data)
if (ctxt != NULL) {
data = ctxt;
} else {
data = xmlGenericErrorContext;
}
}
if (channel == NULL)
return;