diff --git a/xmllint.c b/xmllint.c index 2f725b8a..1b90b38e 100644 --- a/xmllint.c +++ b/xmllint.c @@ -485,12 +485,16 @@ static void xmlHTMLPrintError(void *ctx, const char *level, const char *msg, va_list ap) { xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx; xmlParserInputPtr input; + xmlGenericErrorFunc oldError; + void *oldErrorCtxt; input = ctxt->input; if ((input != NULL) && (input->filename == NULL) && (ctxt->inputNr > 1)) { input = ctxt->inputTab[ctxt->inputNr - 2]; } + oldError = xmlGenericError; + oldErrorCtxt = xmlGenericErrorContext; xmlSetGenericErrorFunc(NULL, xmlHTMLBufCat); fprintf(ERR_STREAM, "

"); @@ -514,7 +518,7 @@ xmlHTMLPrintError(void *ctx, const char *level, const char *msg, va_list ap) { fprintf(ERR_STREAM, ""); } - xmlSetGenericErrorFunc(NULL, NULL); + xmlSetGenericErrorFunc(oldErrorCtxt, oldError); } /**