summaryrefslogtreecommitdiff
path: root/error.c
diff options
context:
space:
mode:
authorMike Hommey <glandium@debian.org>2009-09-10 22:10:39 +0200
committerMike Hommey <glandium@debian.org>2009-09-10 22:10:39 +0200
commitc3e4f3c26035bc93a69e5aa2ad435809e8be8a4e (patch)
treee65557c2e042fe8a77635b0548db10ad97bc1bfe /error.c
parente248b20a3b7df364cc9617b8685b4c190338bcd2 (diff)
downloadlibxml2-c3e4f3c26035bc93a69e5aa2ad435809e8be8a4e.tar.gz
Import upstream version 2.7.4upstream/2.7.4.dfsg
Diffstat (limited to 'error.c')
-rw-r--r--error.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/error.c b/error.c
index 5f03d94..814e4ea 100644
--- a/error.c
+++ b/error.c
@@ -132,7 +132,7 @@ xmlSetGenericErrorFunc(void *ctx, xmlGenericErrorFunc handler) {
*/
void
xmlSetStructuredErrorFunc(void *ctx, xmlStructuredErrorFunc handler) {
- xmlGenericErrorContext = ctx;
+ xmlStructuredErrorContext = ctx;
xmlStructuredError = handler;
}
@@ -471,7 +471,7 @@ __xmlRaiseError(xmlStructuredErrorFunc schannel,
* if user has defined handler, change data ptr to user's choice
*/
if (schannel != NULL)
- data = xmlGenericErrorContext;
+ data = xmlStructuredErrorContext;
}
if ((domain == XML_FROM_VALID) &&
((channel == xmlParserValidityError) ||
@@ -573,7 +573,6 @@ __xmlRaiseError(xmlStructuredErrorFunc schannel,
if ((to->file == NULL) && (node != NULL) && (node->doc != NULL)) {
to->file = (char *) xmlStrdup(node->doc->URL);
}
- file = to->file;
}
to->line = line;
if (str1 != NULL)
@@ -593,20 +592,23 @@ __xmlRaiseError(xmlStructuredErrorFunc schannel,
/*
* Find the callback channel if channel param is NULL
*/
- if ((ctxt != NULL) && (channel == NULL) && (xmlStructuredError == NULL) && (ctxt->sax != NULL)) {
+ if ((ctxt != NULL) && (channel == NULL) &&
+ (xmlStructuredError == NULL) && (ctxt->sax != NULL)) {
if (level == XML_ERR_WARNING)
channel = ctxt->sax->warning;
else
channel = ctxt->sax->error;
data = ctxt->userData;
} else if (channel == NULL) {
- if (xmlStructuredError != NULL)
+ if ((schannel == NULL) && (xmlStructuredError != NULL)) {
schannel = xmlStructuredError;
- else
+ data = xmlStructuredErrorContext;
+ } else {
channel = xmlGenericError;
- if (!data) {
- data = xmlGenericErrorContext;
- }
+ if (!data) {
+ data = xmlGenericErrorContext;
+ }
+ }
}
if (schannel != NULL) {
schannel(data, to);