diff options
author | Mike Hommey <glandium@debian.org> | 2009-09-10 22:10:39 +0200 |
---|---|---|
committer | Mike Hommey <glandium@debian.org> | 2009-09-10 22:10:39 +0200 |
commit | c3e4f3c26035bc93a69e5aa2ad435809e8be8a4e (patch) | |
tree | e65557c2e042fe8a77635b0548db10ad97bc1bfe /error.c | |
parent | e248b20a3b7df364cc9617b8685b4c190338bcd2 (diff) | |
download | libxml2-c3e4f3c26035bc93a69e5aa2ad435809e8be8a4e.tar.gz |
Import upstream version 2.7.4upstream/2.7.4.dfsg
Diffstat (limited to 'error.c')
-rw-r--r-- | error.c | 20 |
1 files changed, 11 insertions, 9 deletions
@@ -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); |