libxml2 r3758 - trunk



Author: veillard
Date: Tue Jul 29 16:44:59 2008
New Revision: 3758
URL: http://svn.gnome.org/viewvc/libxml2?rev=3758&view=rev

Log:
* parser.c: fix a bug not detecting cross entity comments probably
  when comment parsing got optimized.
* Makefile.am: add make check
* runxmlconf.c: fix the log file name
Daniel


Modified:
   trunk/ChangeLog
   trunk/Makefile.am
   trunk/parser.c
   trunk/runxmlconf.c

Modified: trunk/Makefile.am
==============================================================================
--- trunk/Makefile.am	(original)
+++ trunk/Makefile.am	Tue Jul 29 16:44:59 2008
@@ -166,7 +166,10 @@
 #testOOM_DEPENDENCIES = $(DEPS)
 #testOOM_LDADD= $(LDADDS)
 
-check-local: all tests
+runtests:
+	runtest$(EXEEXT) && testapi$(EXEEXT) && runxmlconf$(EXEEXT)
+
+check-local: all runtests
 
 testall : tests SVGtests SAXtests
 

Modified: trunk/parser.c
==============================================================================
--- trunk/parser.c	(original)
+++ trunk/parser.c	Tue Jul 29 16:44:59 2008
@@ -4203,8 +4203,10 @@
     int q, ql;
     int r, rl;
     int cur, l;
-    xmlParserInputPtr input = ctxt->input;
     int count = 0;
+    int inputid;
+
+    inputid = ctxt->input->id;
 
     if (buf == NULL) {
         len = 0;
@@ -4286,7 +4288,7 @@
                           "xmlParseComment: invalid xmlChar value %d\n",
 	                  cur);
     } else {
-	if (input != ctxt->input) {
+	if (inputid != ctxt->input->id) {
 	    xmlFatalErrMsg(ctxt, XML_ERR_ENTITY_BOUNDARY,
 		"Comment doesn't start and stop in the same entity\n");
 	}
@@ -4322,15 +4324,16 @@
     xmlParserInputState state;
     const xmlChar *in;
     int nbchar = 0, ccol;
+    int inputid;
 
     /*
      * Check that there is a comment right here.
      */
     if ((RAW != '<') || (NXT(1) != '!') ||
         (NXT(2) != '-') || (NXT(3) != '-')) return;
-
     state = ctxt->instate;
     ctxt->instate = XML_PARSER_COMMENT;
+    inputid = ctxt->input->id;
     SKIP(4);
     SHRINK;
     GROW;
@@ -4421,6 +4424,10 @@
 	if (*in == '-') {
 	    if (in[1] == '-') {
 	        if (in[2] == '>') {
+		    if (ctxt->input->id != inputid) {
+			xmlFatalErrMsg(ctxt, XML_ERR_ENTITY_BOUNDARY,
+			"comment doesn't start and stop in the same entity\n");
+		    }
 		    SKIP(3);
 		    if ((ctxt->sax != NULL) && (ctxt->sax->comment != NULL) &&
 		        (!ctxt->disableSAX)) {

Modified: trunk/runxmlconf.c
==============================================================================
--- trunk/runxmlconf.c	(original)
+++ trunk/runxmlconf.c	Tue Jul 29 16:44:59 2008
@@ -29,7 +29,7 @@
 #include <libxml/xpath.h>
 #include <libxml/xpathInternals.h>
 
-#define LOGFILE "runsuite.log"
+#define LOGFILE "runxmlconf.log"
 static FILE *logfile = NULL;
 static int verbose = 0;
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]