From db5850a23a2bd9d3605d0a1280928428d0bc387f Mon Sep 17 00:00:00 2001 From: Daniel Veillard Date: Fri, 18 Jan 2002 11:49:26 +0000 Subject: [PATCH] Keith Isdale complained rightly that xmlInitParser() did not preserve * parser.c error.c: Keith Isdale complained rightly that xmlInitParser() did not preserve value set by xmlSetGenericErrorFunc Daniel --- ChangeLog | 7 ++++++- error.c | 10 +++++----- parser.c | 5 ++++- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index ed6391b6..aaba7246 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Fri Jan 18 12:47:15 CET 2002 Daniel Veillard + + * parser.c error.c: Keith Isdale complained rightly that + xmlInitParser() did not preserve value set by xmlSetGenericErrorFunc + Thu Jan 17 09:44:44 CET 2002 Daniel Veillard * tree.c: fixed the funxtion to set the xml: attributes @@ -108,7 +113,7 @@ Mon Jan 7 00:03:58 CET 2002 Daniel Veillard Sun Jan 6 13:45:49 CET 2002 Daniel Veillard - * parser.c: patch from Jack J Franklin to remove a bug in + * parser.c: patch from Frank J Franklin to remove a bug in xmlCreatePushParserCtxt() when the initial buffer passed is large. diff --git a/error.c b/error.c index 15d6246f..51e5da8b 100644 --- a/error.c +++ b/error.c @@ -75,12 +75,12 @@ xmlGenericErrorDefaultFunc(void *ctx ATTRIBUTE_UNUSED, const char *msg, ...) { } void -initGenericErrorDefaultFunc(xmlGenericErrorFunc *handler) +initGenericErrorDefaultFunc(xmlGenericErrorFunc * handler) { - if (handler == NULL) - xmlGenericError = xmlGenericErrorDefaultFunc; - else - (*handler) = xmlGenericErrorDefaultFunc; + if (handler == NULL) + xmlGenericError = xmlGenericErrorDefaultFunc; + else + (*handler) = xmlGenericErrorDefaultFunc; } /** diff --git a/parser.c b/parser.c index f7164188..3c8e8beb 100644 --- a/parser.c +++ b/parser.c @@ -10286,6 +10286,7 @@ xmlSetEntityReferenceFunc(xmlEntityReferenceFunc func) #include #endif +extern void xmlGenericErrorDefaultFunc(void *ctx, const char *msg, ...); static int xmlParserInitialized = 0; /** @@ -10301,7 +10302,9 @@ xmlInitParser(void) { if (xmlParserInitialized != 0) return; - initGenericErrorDefaultFunc(NULL); + if ((xmlGenericError == xmlGenericErrorDefaultFunc) || + (xmlGenericError == NULL)) + initGenericErrorDefaultFunc(NULL); xmlInitThreads(); xmlInitMemory(); xmlInitCharEncodingHandlers();