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.
diff --git a/error.c b/error.c
index 1c2fb36..6b7ef59 100644
--- a/error.c
+++ b/error.c
@@ -615,8 +615,11 @@
data = ctxt->userData;
} else if (channel == NULL) {
channel = xmlGenericError;
- if (!data)
+ if (ctxt != NULL) {
+ data = ctxt;
+ } else {
data = xmlGenericErrorContext;
+ }
}
if (channel == NULL)
return;