Fixed #6766 and satrted working on white space handling, Daniel
diff --git a/ChangeLog b/ChangeLog
index 138942e..05541d8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Thu Mar  2 02:26:13 CET 2000 Daniel Veillard <Daniel.Veillard@w3.org>
+
+	* parser.c: tried to remove the <a>   </a> generating <a/>
+	  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 <Daniel.Veillard@w3.org>
 
 	* doc/xml.html : applied second patch from Paul DuBois
diff --git a/Makefile.am b/Makefile.am
index d7ed138..5a89baa 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -256,8 +256,6 @@
 
 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 3665b54..d055507 100644
--- a/configure.in
+++ b/configure.in
@@ -5,7 +5,7 @@
 
 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 e02751c..0f2c56a 100644
--- a/include/libxml/parser.h
+++ b/include/libxml/parser.h
@@ -159,6 +159,7 @@
 
     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 015640c..4a9d901 100644
--- a/parser.c
+++ b/parser.c
@@ -263,6 +263,7 @@
 
 int xmlSubstituteEntitiesDefaultValue = 0;
 int xmlDoValidityCheckingDefaultValue = 0;
+int xmlKeepBlanksDefaultValue = 0;
 xmlEntityPtr xmlParseStringEntityRef(xmlParserCtxtPtr ctxt,
                                      const xmlChar ** str);
 
@@ -684,6 +685,7 @@
     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 @@
     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 @@
     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 e02751c..0f2c56a 100644
--- a/parser.h
+++ b/parser.h
@@ -159,6 +159,7 @@
 
     long               nbChars;       /* number of xmlChar processed */
     long            checkIndex;       /* used by progressive parsing lookup */
+    int             keepBlanks;       /* ugly but ... */
 };
 
 /**