1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2024-10-26 20:25:14 +03:00

Patch for HP compilers and patch to xmllint.c from Sven Heinicke, Daniel

This commit is contained in:
Daniel Veillard 2000-08-04 18:23:10 +00:00
parent a2679fa421
commit 88a172f75f
3 changed files with 44 additions and 17 deletions

View File

@ -1,3 +1,12 @@
Fri Aug 4 11:21:50 PDT 2000 Daniel Veillard <Daniel.Veillard@w3.org>
* configure.in: patch for HP compiler
2000-08-04 Sven Heinicke <sven@zen.org>
* xmllint.c: Was coredumping sometimes when the file given didn't
exist.
Sat Jul 22 05:59:05 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org>
* parser.c xmlIO.[ch]: fixed the problem of encoding support

View File

@ -126,7 +126,7 @@ dnl
if test "${CC}" != "gcc" ; then
case "${host}" in
*-*-hpux* )
CFLAGS="${CFLAGS} -Wp,-H16800 -Ae"
CFLAGS="${CFLAGS} -Wp,-H30000 -Ae"
;;
esac
fi

View File

@ -426,30 +426,39 @@ void parseAndPrintFile(char *filename) {
xmlSAXHandler silent, *old;
ctxt = xmlCreateFileParserCtxt(filename);
memcpy(&silent, ctxt->sax, sizeof(silent));
old = ctxt->sax;
silent.error = xmlHTMLError;
if (xmlGetWarningsDefaultValue)
if (ctxt == NULL) {
/* If xmlCreateFileParseCtxt() return NULL something
strange happened so we don't want to do anything. Do
we want to print an error message here?
<sven@zen.org> */
doc == NULL;
} else {
memcpy(&silent, ctxt->sax, sizeof(silent));
old = ctxt->sax;
silent.error = xmlHTMLError;
if (xmlGetWarningsDefaultValue)
silent.warning = xmlHTMLWarning;
else
else
silent.warning = NULL;
silent.fatalError = xmlHTMLError;
ctxt->sax = &silent;
ctxt->vctxt.error = xmlHTMLValidityError;
if (xmlGetWarningsDefaultValue)
silent.fatalError = xmlHTMLError;
ctxt->sax = &silent;
ctxt->vctxt.error = xmlHTMLValidityError;
if (xmlGetWarningsDefaultValue)
ctxt->vctxt.warning = xmlHTMLValidityWarning;
else
else
ctxt->vctxt.warning = NULL;
xmlParseDocument(ctxt);
xmlParseDocument(ctxt);
ret = ctxt->wellFormed;
doc = ctxt->myDoc;
ctxt->sax = old;
xmlFreeParserCtxt(ctxt);
if (!ret) {
ret = ctxt->wellFormed;
doc = ctxt->myDoc;
ctxt->sax = old;
xmlFreeParserCtxt(ctxt);
if (!ret) {
xmlFreeDoc(doc);
doc = NULL;
}
}
#ifdef HAVE_SYS_MMAN_H
} else if (memory) {
@ -473,6 +482,14 @@ void parseAndPrintFile(char *filename) {
}
#endif
/*
* If we don't have a document we might as well give up. Do we
* want an error message here? <sven@zen.org> */
if (doc == NULL)
{
return;
}
#ifdef LIBXML_DEBUG_ENABLED
/*
* shell interraction
@ -703,3 +720,4 @@ int main(int argc, char **argv) {
return(0);
}