diff --git a/ChangeLog b/ChangeLog index 138942ec..05541d8d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Thu Mar 2 02:26:13 CET 2000 Daniel Veillard + + * parser.c: tried to remove the generating + this is hard. Left a flag for that purpose. Fixed bug #6766 + * configure.in: prepared 1.8.7 not released, due to previous + problem + Thu Mar 2 03:03:50 CET 2000 Daniel Veillard * doc/xml.html : applied second patch from Paul DuBois diff --git a/Makefile.am b/Makefile.am index d7ed138e..5a89baa2 100644 --- a/Makefile.am +++ b/Makefile.am @@ -256,8 +256,6 @@ confexec_DATA = xmlConf.sh CLEANFILES=xmlConf.sh -EXTRA_DIST = xmlConf.sh.in - confexecdir=$(libdir) confexec_DATA = xmlConf.sh EXTRA_DIST = xmlConf.sh.in libxml.spec.in libxml.spec \ diff --git a/configure.in b/configure.in index 3665b54a..d0555070 100644 --- a/configure.in +++ b/configure.in @@ -5,7 +5,7 @@ AM_CONFIG_HEADER(config.h) LIBXML_MAJOR_VERSION=1 LIBXML_MINOR_VERSION=8 -LIBXML_MICRO_VERSION=6 +LIBXML_MICRO_VERSION=7 LIBXML_VERSION=$LIBXML_MAJOR_VERSION.$LIBXML_MINOR_VERSION.$LIBXML_MICRO_VERSION LIBXML_VERSION_INFO=`expr $LIBXML_MAJOR_VERSION + $LIBXML_MINOR_VERSION`:$LIBXML_MICRO_VERSION:$LIBXML_MINOR_VERSION diff --git a/include/libxml/parser.h b/include/libxml/parser.h index e02751ca..0f2c56af 100644 --- a/include/libxml/parser.h +++ b/include/libxml/parser.h @@ -159,6 +159,7 @@ struct _xmlParserCtxt { long nbChars; /* number of xmlChar processed */ long checkIndex; /* used by progressive parsing lookup */ + int keepBlanks; /* ugly but ... */ }; /** diff --git a/parser.c b/parser.c index 015640c0..4a9d9012 100644 --- a/parser.c +++ b/parser.c @@ -263,6 +263,7 @@ xmlParserInputShrink(xmlParserInputPtr in) { int xmlSubstituteEntitiesDefaultValue = 0; int xmlDoValidityCheckingDefaultValue = 0; +int xmlKeepBlanksDefaultValue = 0; xmlEntityPtr xmlParseStringEntityRef(xmlParserCtxtPtr ctxt, const xmlChar ** str); @@ -684,6 +685,7 @@ xmlInitParserCtxt(xmlParserCtxtPtr ctxt) ctxt->wellFormed = 1; ctxt->valid = 1; ctxt->validate = xmlDoValidityCheckingDefaultValue; + ctxt->keepBlanks = xmlKeepBlanksDefaultValue; ctxt->vctxt.userData = ctxt; if (ctxt->validate) { ctxt->vctxt.error = xmlParserValidityError; @@ -2077,27 +2079,37 @@ static int areBlanks(xmlParserCtxtPtr ctxt, const xmlChar *str, int len) { int i, ret; xmlNodePtr lastChild; + /* + * Check that the string is made of blanks + */ for (i = 0;i < len;i++) if (!(IS_BLANK(str[i]))) return(0); - if (CUR != '<') return(0); - if (ctxt->node == NULL) return(0); + /* + * Look if the element is mixed content in the Dtd if available + */ if (ctxt->myDoc != NULL) { ret = xmlIsMixedElement(ctxt->myDoc, ctxt->node->name); if (ret == 0) return(1); if (ret == 1) return(0); } + /* - * heuristic + * Do we allow an heuristic on white space */ + if (ctxt->keepBlanks) + return(0); + if (CUR != '<') return(0); + if (ctxt->node == NULL) return(0); + lastChild = xmlGetLastChild(ctxt->node); if (lastChild == NULL) { - if (ctxt->node->content != NULL) return(0); + if (ctxt->node->content != NULL) return(0); } else if (xmlNodeIsText(lastChild)) - return(0); + return(0); else if ((ctxt->node->childs != NULL) && - (xmlNodeIsText(ctxt->node->childs))) - return(0); + (xmlNodeIsText(ctxt->node->childs))) + return(0); return(1); } @@ -8319,7 +8331,8 @@ xmlCreateMemoryParserCtxt(char *buffer, int size) { xmlParserInputPtr input; xmlCharEncoding enc; - buffer[size - 1] = '\0'; + if (buffer[size] != '\0') + buffer[size] = '\0'; ctxt = xmlNewParserCtxt(); if (ctxt == NULL) { diff --git a/parser.h b/parser.h index e02751ca..0f2c56af 100644 --- a/parser.h +++ b/parser.h @@ -159,6 +159,7 @@ struct _xmlParserCtxt { long nbChars; /* number of xmlChar processed */ long checkIndex; /* used by progressive parsing lookup */ + int keepBlanks; /* ugly but ... */ }; /**