1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-10-24 13:33:01 +03:00

parser: Stop using 'directory' struct member

This was only used as a pointless fallback for URI resolution.
This commit is contained in:
Nick Wellnhofer
2023-12-23 00:58:36 +01:00
parent 60841beba6
commit 955c177f69
9 changed files with 4 additions and 82 deletions

View File

@@ -12042,16 +12042,6 @@ xmlCreatePushParserCtxt(xmlSAXHandlerPtr sax, void *user_data,
return(NULL);
}
ctxt->dictNames = 1;
if (filename == NULL) {
ctxt->directory = NULL;
} else {
ctxt->directory = xmlParserGetDirectory(filename);
if (ctxt->directory == NULL) {
xmlFreeParserCtxt(ctxt);
xmlFreeParserInputBuffer(buf);
return(NULL);
}
}
inputStream = xmlNewInputStream(ctxt);
if (inputStream == NULL) {
@@ -13452,14 +13442,6 @@ xmlCreateEntityParserCtxtInternal(xmlSAXHandlerPtr sax, void *userData,
inputPush(ctxt, inputStream);
if (ctxt->directory == NULL) {
ctxt->directory = xmlParserGetDirectory((char *)URL);
if (ctxt->directory == NULL) {
xmlErrMemory(ctxt);
goto error;
}
}
xmlFree(uri);
return(ctxt);
@@ -13522,7 +13504,6 @@ xmlCreateURLParserCtxt(const char *filename, int options)
{
xmlParserCtxtPtr ctxt;
xmlParserInputPtr inputStream;
char *directory = NULL;
ctxt = xmlNewParserCtxt();
if (ctxt == NULL)
@@ -13539,10 +13520,6 @@ xmlCreateURLParserCtxt(const char *filename, int options)
}
inputPush(ctxt, inputStream);
if ((ctxt->directory == NULL) && (directory == NULL))
directory = xmlParserGetDirectory(filename);
if ((ctxt->directory == NULL) && (directory != NULL))
ctxt->directory = directory;
return(ctxt);
}
@@ -13607,9 +13584,6 @@ xmlSAXParseFileWithData(xmlSAXHandlerPtr sax, const char *filename,
ctxt->_private = data;
}
if (ctxt->directory == NULL)
ctxt->directory = xmlParserGetDirectory(filename);
ctxt->recovery = recovery;
xmlParseDocument(ctxt);
@@ -14227,8 +14201,6 @@ xmlCtxtReset(xmlParserCtxtPtr ctxt)
ctxt->version = NULL;
DICT_FREE(ctxt->encoding);
ctxt->encoding = NULL;
DICT_FREE(ctxt->directory);
ctxt->directory = NULL;
DICT_FREE(ctxt->extSubURI);
ctxt->extSubURI = NULL;
DICT_FREE(ctxt->extSubSystem);
@@ -14317,12 +14289,6 @@ xmlCtxtResetPush(xmlParserCtxtPtr ctxt, const char *chunk,
xmlCtxtReset(ctxt);
if (filename == NULL) {
ctxt->directory = NULL;
} else {
ctxt->directory = xmlParserGetDirectory(filename);
}
inputStream = xmlNewInputStream(ctxt);
if (inputStream == NULL) {
xmlFreeParserInputBuffer(buf);