io: Fix resetting xmlParserInputBufferCreateFilename hook

We don't want to invoke the default function.
This commit is contained in:
Nick Wellnhofer 2024-06-10 18:50:28 +02:00
parent 47cbb6bb3c
commit 717f3a7b21

14
xmlIO.c
View File

@ -2211,13 +2211,17 @@ xmlOutputBufferCreateIO(xmlOutputWriteCallback iowrite,
* Returns the old value of the registration function
*/
xmlParserInputBufferCreateFilenameFunc
xmlParserInputBufferCreateFilenameDefault(xmlParserInputBufferCreateFilenameFunc func)
xmlParserInputBufferCreateFilenameDefault(
xmlParserInputBufferCreateFilenameFunc func)
{
xmlParserInputBufferCreateFilenameFunc old = xmlParserInputBufferCreateFilenameValue;
if (old == NULL) {
old = __xmlParserInputBufferCreateFilename;
}
xmlParserInputBufferCreateFilenameFunc old;
old = xmlParserInputBufferCreateFilenameValue;
if (old == NULL)
old = __xmlParserInputBufferCreateFilename;
if (func == __xmlParserInputBufferCreateFilename)
func = NULL;
xmlParserInputBufferCreateFilenameValue = func;
return(old);
}