mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-07-25 02:02:11 +03:00
added --nonet option fixing #112803 by adding --nonet when calling
* xmllint.c doc/xmllint.xml: added --nonet option * doc/Makefile.am: fixing #112803 by adding --nonet when calling xsltproc or xmllint * doc/xmllint.xml doc/xmllint.1: also added --schema doc and rebuilt * HTMLparser.c: cleaned up the HTML parser context build when using an URL Daniel
This commit is contained in:
31
HTMLparser.c
31
HTMLparser.c
@ -5348,6 +5348,7 @@ htmlCreateFileParserCtxt(const char *filename, const char *encoding)
|
||||
htmlParserCtxtPtr ctxt;
|
||||
htmlParserInputPtr inputStream;
|
||||
xmlParserInputBufferPtr buf;
|
||||
char *canonicFilename;
|
||||
/* htmlCharEncoding enc; */
|
||||
xmlChar *content, *content_line = (xmlChar *) "charset=";
|
||||
|
||||
@ -5361,27 +5362,23 @@ htmlCreateFileParserCtxt(const char *filename, const char *encoding)
|
||||
}
|
||||
memset(ctxt, 0, sizeof(htmlParserCtxt));
|
||||
htmlInitParserCtxt(ctxt);
|
||||
inputStream = (htmlParserInputPtr) xmlMalloc(sizeof(htmlParserInput));
|
||||
if (inputStream == NULL) {
|
||||
xmlGenericError(xmlGenericErrorContext, "malloc failed\n");
|
||||
xmlFree(ctxt);
|
||||
canonicFilename = (char *) xmlCanonicPath((const xmlChar *) filename);
|
||||
if (canonicFilename == NULL) {
|
||||
if (xmlDefaultSAXHandler.error != NULL) {
|
||||
xmlDefaultSAXHandler.error(NULL, "out of memory\n");
|
||||
}
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
inputStream = xmlLoadExternalEntity(canonicFilename, NULL, ctxt);
|
||||
xmlFree(canonicFilename);
|
||||
if (inputStream == NULL) {
|
||||
xmlFreeParserCtxt(ctxt);
|
||||
return(NULL);
|
||||
}
|
||||
memset(inputStream, 0, sizeof(htmlParserInput));
|
||||
|
||||
inputStream->filename = (char *)
|
||||
xmlCanonicPath((xmlChar *)filename);
|
||||
inputStream->line = 1;
|
||||
inputStream->col = 1;
|
||||
inputStream->buf = buf;
|
||||
inputStream->directory = NULL;
|
||||
|
||||
inputStream->base = inputStream->buf->buffer->content;
|
||||
inputStream->cur = inputStream->buf->buffer->content;
|
||||
inputStream->free = NULL;
|
||||
|
||||
inputPush(ctxt, inputStream);
|
||||
|
||||
|
||||
/* set encoding */
|
||||
if (encoding) {
|
||||
content = xmlMallocAtomic (xmlStrlen(content_line) + strlen(encoding) + 1);
|
||||
|
Reference in New Issue
Block a user