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

io: Remove xmlParserInputBufferCreateFilenameSafe

This commit is contained in:
Nick Wellnhofer
2024-06-10 18:51:56 +02:00
parent 1b1e8b3c12
commit b5890cb425
3 changed files with 18 additions and 32 deletions

View File

@@ -2039,14 +2039,21 @@ xmlNewInputFromFile(xmlParserCtxtPtr ctxt, const char *filename) {
xmlParserInputPtr inputStream;
const xmlChar *URI;
xmlChar *canonic;
int code;
int code = XML_ERR_OK;
if ((ctxt == NULL) || (filename == NULL))
return(NULL);
code = xmlParserInputBufferCreateFilenameSafe(filename,
XML_CHAR_ENCODING_NONE, &buf);
if (buf == NULL) {
if (xmlParserInputBufferCreateFilenameValue != NULL) {
buf = xmlParserInputBufferCreateFilenameValue(filename,
XML_CHAR_ENCODING_NONE);
if (buf == NULL)
code = XML_IO_ENOENT;
} else {
code = xmlParserInputBufferCreateFilenameInt(filename,
XML_CHAR_ENCODING_NONE, &buf);
}
if (code != XML_ERR_OK) {
xmlCtxtErrIO(ctxt, code, filename);
return(NULL);
}