[libxml2] Fix problem with specific and generic error handlers
- From: Daniel Veillard <veillard src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libxml2] Fix problem with specific and generic error handlers
- Date: Mon, 27 Aug 2012 05:25:46 +0000 (UTC)
commit 890faa546bf386816dea59d0f1075bc3a42de263
Author: Pietro Cerutti <gahr gahr ch>
Date: Mon Aug 27 13:24:08 2012 +0800
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.
error.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/error.c b/error.c
index 1c2fb36..6b7ef59 100644
--- a/error.c
+++ b/error.c
@@ -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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]