1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-03-23 02:50:08 +03:00

io: Add missing calls to xmlInitParser

This is required after c9a46a91.

Should fix #782.
This commit is contained in:
Nick Wellnhofer 2024-08-13 14:38:07 +02:00
parent 0c56eb8215
commit f2c48847fa

16
xmlIO.c
View File

@ -1381,6 +1381,8 @@ xmlParserInputBufferCreateUrl(const char *URI, xmlCharEncoding enc,
int ret;
int i;
xmlInitParser();
*out = NULL;
if (URI == NULL)
return(XML_ERR_ARGUMENT);
@ -1469,6 +1471,8 @@ __xmlOutputBufferCreateFilename(const char *URI,
int i = 0;
char *unescaped = NULL;
xmlInitParser();
if (URI == NULL)
return(NULL);
@ -2646,6 +2650,8 @@ int
xmlRegisterInputCallbacks(xmlInputMatchCallback matchFunc,
xmlInputOpenCallback openFunc, xmlInputReadCallback readFunc,
xmlInputCloseCallback closeFunc) {
xmlInitParser();
if (xmlInputCallbackNr >= MAX_INPUT_CALLBACK) {
return(-1);
}
@ -2677,6 +2683,8 @@ xmlRegisterDefaultInputCallbacks(void) {
int
xmlPopInputCallbacks(void)
{
xmlInitParser();
if (xmlInputCallbackNr <= 0)
return(-1);
@ -2694,6 +2702,8 @@ xmlPopInputCallbacks(void)
void
xmlCleanupInputCallbacks(void)
{
xmlInitParser();
xmlInputCallbackNr = 0;
}
@ -2713,6 +2723,8 @@ int
xmlRegisterOutputCallbacks(xmlOutputMatchCallback matchFunc,
xmlOutputOpenCallback openFunc, xmlOutputWriteCallback writeFunc,
xmlOutputCloseCallback closeFunc) {
xmlInitParser();
if (xmlOutputCallbackNr >= MAX_OUTPUT_CALLBACK) {
return(-1);
}
@ -2744,6 +2756,8 @@ xmlRegisterDefaultOutputCallbacks (void) {
int
xmlPopOutputCallbacks(void)
{
xmlInitParser();
if (xmlOutputCallbackNr <= 0)
return(-1);
@ -2761,6 +2775,8 @@ xmlPopOutputCallbacks(void)
void
xmlCleanupOutputCallbacks(void)
{
xmlInitParser();
xmlOutputCallbackNr = 0;
}