mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-10-26 00:37:43 +03:00
error: Don't use initGenericErrorDefaultFunc
The code in xmlInitParser did only set the error handler if it was NULL which should never happen.
This commit is contained in:
2
error.c
2
error.c
@@ -81,6 +81,8 @@ xmlGenericErrorDefaultFunc(void *ctx ATTRIBUTE_UNUSED, const char *msg, ...) {
|
|||||||
* initGenericErrorDefaultFunc:
|
* initGenericErrorDefaultFunc:
|
||||||
* @handler: the handler
|
* @handler: the handler
|
||||||
*
|
*
|
||||||
|
* DEPRECATED: Use xmlSetGenericErrorFunc.
|
||||||
|
*
|
||||||
* Set or reset (if NULL) the default handler for generic errors
|
* Set or reset (if NULL) the default handler for generic errors
|
||||||
* to the builtin error function.
|
* to the builtin error function.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -864,6 +864,7 @@ typedef void (XMLCALL *xmlStructuredErrorFunc) (void *userData, xmlErrorPtr erro
|
|||||||
XMLPUBFUN void XMLCALL
|
XMLPUBFUN void XMLCALL
|
||||||
xmlSetGenericErrorFunc (void *ctx,
|
xmlSetGenericErrorFunc (void *ctx,
|
||||||
xmlGenericErrorFunc handler);
|
xmlGenericErrorFunc handler);
|
||||||
|
XML_DEPRECATED
|
||||||
XMLPUBFUN void XMLCALL
|
XMLPUBFUN void XMLCALL
|
||||||
initGenericErrorDefaultFunc (xmlGenericErrorFunc *handler);
|
initGenericErrorDefaultFunc (xmlGenericErrorFunc *handler);
|
||||||
|
|
||||||
|
|||||||
3
parser.c
3
parser.c
@@ -14725,9 +14725,6 @@ xmlInitParser(void) {
|
|||||||
#endif
|
#endif
|
||||||
xmlInitThreads();
|
xmlInitThreads();
|
||||||
xmlInitGlobals();
|
xmlInitGlobals();
|
||||||
if ((xmlGenericError == xmlGenericErrorDefaultFunc) ||
|
|
||||||
(xmlGenericError == NULL))
|
|
||||||
initGenericErrorDefaultFunc(NULL);
|
|
||||||
xmlInitMemory();
|
xmlInitMemory();
|
||||||
xmlInitializeDict();
|
xmlInitializeDict();
|
||||||
xmlInitCharEncodingHandlers();
|
xmlInitCharEncodingHandlers();
|
||||||
|
|||||||
@@ -2427,12 +2427,11 @@ ignoreGenericError(void *ctx ATTRIBUTE_UNUSED,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
testXPath(const char *str, int xptr, int expr) {
|
testXPath(const char *str, int xptr, int expr) {
|
||||||
xmlGenericErrorFunc handler = ignoreGenericError;
|
|
||||||
xmlXPathObjectPtr res;
|
xmlXPathObjectPtr res;
|
||||||
xmlXPathContextPtr ctxt;
|
xmlXPathContextPtr ctxt;
|
||||||
|
|
||||||
/* Don't print generic errors to stderr. */
|
/* Don't print generic errors to stderr. */
|
||||||
initGenericErrorDefaultFunc(&handler);
|
xmlSetGenericErrorFunc(NULL, ignoreGenericError);
|
||||||
|
|
||||||
nb_tests++;
|
nb_tests++;
|
||||||
#if defined(LIBXML_XPTR_ENABLED)
|
#if defined(LIBXML_XPTR_ENABLED)
|
||||||
@@ -2464,7 +2463,7 @@ testXPath(const char *str, int xptr, int expr) {
|
|||||||
xmlXPathFreeContext(ctxt);
|
xmlXPathFreeContext(ctxt);
|
||||||
|
|
||||||
/* Reset generic error handler. */
|
/* Reset generic error handler. */
|
||||||
initGenericErrorDefaultFunc(NULL);
|
xmlSetGenericErrorFunc(NULL, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user