fixed second spot where CRLF split between chunks could cause trouble (bug

* parser.c: fixed second spot where CRLF split between chunks
  could cause trouble (bug #319279)
* gentest.py, testapi.c: fixed two problems involved with
  --with-minimum compilation (compilation errors with schematron
  and formal expressions tests)
diff --git a/ChangeLog b/ChangeLog
index 5b3fbe1..8772b3a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+Sat Oct 22 10:00:41 HKT 2005 William Brack <wbrack@mmm.com.hk>
+
+	* parser.c: fixed second spot where CRLF split between chunks
+	  could cause trouble (bug #319279)
+	* gentest.py, testapi.c: fixed two problems involved with
+	  --with-minimum compilation (compilation errors with schematron
+	  and formal expressions tests)
+
 Fri Oct 21 10:50:14 EDT 2005 Rob Richards <rrichards@ctindustries.net>
 
 	* xmlsave.c: prevent output of fragment tags when serializing XHTML.
diff --git a/gentest.py b/gentest.py
index af76b04..8c143af 100755
--- a/gentest.py
+++ b/gentest.py
@@ -46,6 +46,7 @@
     "DOCBparser" : "LIBXML_DOCB_ENABLED",
     "xmlmodule" : "LIBXML_MODULES_ENABLED",
     "pattern" : "LIBXML_PATTERN_ENABLED",
+    "schematron" : "LIBXML_SCHEMATRON_ENABLED",
 }
 
 #
diff --git a/parser.c b/parser.c
index 459c5e9..5f561ee 100644
--- a/parser.c
+++ b/parser.c
@@ -3543,6 +3543,8 @@
 	    ctxt->input->cur = in;
 	    if (*in == 0xD) {
 		in++;
+		if (!*in)	/* if end of current chunk return */
+		    return;
 		if (*in == 0xA) {
 		    ctxt->input->cur = in;
 		    in++;
@@ -3937,6 +3939,8 @@
 		ctxt->input->line++; ctxt->input->col = 1;
 		continue; /* while */
 	    }
+	    if (!*in)	/* if end of current chunk return */
+		return;
 	    in--;
 	}
 	SHRINK;
diff --git a/testapi.c b/testapi.c
index fe2d4c8..c11ec9d 100644
--- a/testapi.c
+++ b/testapi.c
@@ -8,7 +8,13 @@
  * daniel@veillard.com
  */
 
-#include <stdio.h>
+#include "config.h"
+#ifndef	WITH_TRIO
+ #include <stdio.h>
+#else
+ #define TRIO_REPLACE_STDIO
+ #include "trio.h"
+#endif
 #include <string.h>
 #include <libxml/xmlerror.h>
 #include <libxml/relaxng.h>
@@ -689,6 +695,24 @@
 static void des_xmlCharEncoding(int no ATTRIBUTE_UNUSED, xmlCharEncoding val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
 }
 
+#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
+
+#define gen_nb_xmlExpCtxtPtr 1
+static xmlExpCtxtPtr gen_xmlExpCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+    return(NULL);
+}
+static void des_xmlExpCtxtPtr(int no ATTRIBUTE_UNUSED, xmlExpCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+
+#define gen_nb_xmlExpNodePtr 1
+static xmlExpNodePtr gen_xmlExpNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+    return(NULL);
+}
+static void des_xmlExpNodePtr(int no ATTRIBUTE_UNUSED, xmlExpNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+
+#endif
+
 #define gen_nb_xmlHashDeallocator 2
 static void 
 test_xmlHashDeallocator(void *payload ATTRIBUTE_UNUSED, xmlChar *name ATTRIBUTE_UNUSED) {
@@ -17757,6 +17781,7 @@
     return(test_ret);
 }
 
+#ifdef LIBXML_SCHEMATRON_ENABLED
 
 #define gen_nb_xmlSchematronPtr 1
 static xmlSchematronPtr gen_xmlSchematronPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
@@ -17764,6 +17789,8 @@
 }
 static void des_xmlSchematronPtr(int no ATTRIBUTE_UNUSED, xmlSchematronPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
 }
+#endif
+
 
 static int
 test_xmlSchematronNewValidCtxt(void) {
@@ -17774,6 +17801,7 @@
     return(test_ret);
 }
 
+#ifdef LIBXML_SCHEMATRON_ENABLED
 
 #define gen_nb_xmlSchematronParserCtxtPtr 1
 static xmlSchematronParserCtxtPtr gen_xmlSchematronParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
@@ -17781,6 +17809,8 @@
 }
 static void des_xmlSchematronParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchematronParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
 }
+#endif
+
 
 static int
 test_xmlSchematronParse(void) {
@@ -17791,6 +17821,7 @@
     return(test_ret);
 }
 
+#ifdef LIBXML_SCHEMATRON_ENABLED
 
 #define gen_nb_xmlSchematronValidCtxtPtr 1
 static xmlSchematronValidCtxtPtr gen_xmlSchematronValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
@@ -17798,6 +17829,8 @@
 }
 static void des_xmlSchematronValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchematronValidCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
 }
+#endif
+
 
 static int
 test_xmlSchematronValidateDoc(void) {
@@ -31935,16 +31968,6 @@
 	printf("Module xmlreader: %d errors\n", test_ret);
     return(test_ret);
 }
-#ifdef LIBXML_REGEXP_ENABLED
-
-#define gen_nb_xmlExpCtxtPtr 1
-static xmlExpCtxtPtr gen_xmlExpCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
-    return(NULL);
-}
-static void des_xmlExpCtxtPtr(int no ATTRIBUTE_UNUSED, xmlExpCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
-}
-#endif
-
 
 static int
 test_xmlExpCtxtNbCons(void) {
@@ -32013,16 +32036,6 @@
     return(test_ret);
 }
 
-#ifdef LIBXML_REGEXP_ENABLED
-
-#define gen_nb_xmlExpNodePtr 1
-static xmlExpNodePtr gen_xmlExpNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
-    return(NULL);
-}
-static void des_xmlExpNodePtr(int no ATTRIBUTE_UNUSED, xmlExpNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
-}
-#endif
-
 
 static int
 test_xmlExpDump(void) {