Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(984)

Unified Diff: third_party/libxml/error.c

Issue 2951008: Update libxml to 2.7.7. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Created 10 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/libxml/error.c
diff --git a/third_party/libxml/error.c b/third_party/libxml/error.c
index 5f03d940a2accacf46a1edd6100dc6001f1b2dcd..7508d41b074b488447ab474cdf2607e3938a2d9c 100644
--- a/third_party/libxml/error.c
+++ b/third_party/libxml/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);
@@ -927,6 +929,7 @@ xmlCtxtResetLastError(void *ctx)
if (ctxt == NULL)
return;
+ ctxt->errNo = XML_ERR_OK;
if (ctxt->lastError.code == XML_ERR_OK)
return;
xmlResetError(&ctxt->lastError);

Powered by Google App Engine
This is Rietveld 408576698