Trying to fix CR/LF troubles, Daniel
diff --git a/runsuite.c b/runsuite.c
index deef129..3d9d6b7 100644
--- a/runsuite.c
+++ b/runsuite.c
@@ -11,7 +11,6 @@
 #endif
 #include <string.h>
 #include <stdio.h>
-#include <glob.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
@@ -46,11 +45,17 @@
     if (stat(filename, &buf) == -1)
         return(0);
 
+#if defined(_WIN32) && !defined(__CYGWIN__)
+    if (!(buf.st_mode & _S_IFREG))
+        return(0);
+#else
     if (!S_ISREG(buf.st_mode))
         return(0);
+#endif
 
     return(1);
 }
+
 static xmlChar *composeDir(const xmlChar *dir, const xmlChar *path) {
     char buf[500];
 
diff --git a/runtest.c b/runtest.c
index bb4d037..62b129b 100644
--- a/runtest.c
+++ b/runtest.c
@@ -1631,7 +1631,7 @@
         fprintf(stderr, "out of memory\n");
         fatalError();
     }
-    SAXdebug = fopen(temp, "w");
+    SAXdebug = fopen(temp, "wb");
     if (SAXdebug == NULL) {
         fprintf(stderr, "Failed to write to %s\n", temp);
 	free(temp);
@@ -2078,7 +2078,7 @@
 	    fprintf(stderr, "Out of memory\n");
 	    fatalError();
 	}
-	t = fopen(temp, "w");
+	t = fopen(temp, "wb");
 	if (t == NULL) {
 	    fprintf(stderr, "Can't open temp file %s\n", temp);
 	    free(temp);
@@ -2291,14 +2291,14 @@
         fprintf(stderr, "Out of memory\n");
         fatalError();
     }
-    xpathOutput = fopen(temp, "w");
+    xpathOutput = fopen(temp, "wb");
     if (xpathOutput == NULL) {
 	fprintf(stderr, "failed to open output file %s\n", temp);
         free(temp);
 	return(-1);
     }
 
-    input = fopen(filename, "r");
+    input = fopen(filename, "rb");
     if (input == NULL) {
         xmlGenericError(xmlGenericErrorContext,
 		"Cannot open %s for reading\n", filename);
@@ -2480,7 +2480,7 @@
         fprintf(stderr, "Out of memory\n");
         fatalError();
     }
-    xpathOutput = fopen(temp, "w");
+    xpathOutput = fopen(temp, "wb");
     if (xpathOutput == NULL) {
 	fprintf(stderr, "failed to open output file %s\n", temp);
         xmlFreeDoc(xpathDocument);
@@ -2578,13 +2578,13 @@
         fprintf(stderr, "Out of memory\n");
         fatalError();
     }
-    o = fopen(temp, "w");
+    o = fopen(temp, "wb");
     if (o == NULL) {
 	fprintf(stderr, "failed to open output file %s\n", temp);
         free(temp);
 	return(-1);
     }
-    f = fopen(filename, "r");
+    f = fopen(filename, "rb");
     if (f == NULL) {
 	fprintf(stderr, "failed to open input file %s\n", filename);
 	fclose(o);
@@ -2705,7 +2705,7 @@
         fprintf(stderr, "Out of memory\n");
         fatalError();
     }
-    schemasOutput = fopen(temp, "w");
+    schemasOutput = fopen(temp, "wb");
     if (schemasOutput == NULL) {
 	fprintf(stderr, "failed to open output file %s\n", temp);
 	xmlFreeDoc(doc);
@@ -2879,7 +2879,7 @@
         fprintf(stderr, "Out of memory\n");
         fatalError();
     }
-    schemasOutput = fopen(temp, "w");
+    schemasOutput = fopen(temp, "wb");
     if (schemasOutput == NULL) {
 	fprintf(stderr, "failed to open output file %s\n", temp);
 	xmlFreeDoc(doc);
@@ -3215,7 +3215,7 @@
 	fprintf(stderr, "Missing result file %s\n", result);
 	return(-1);
     }
-    f = fopen(filename, "r");
+    f = fopen(filename, "rb");
     if (f == NULL) {
         fprintf(stderr, "Failed to open %s\n", filename);
 	return(-1);
@@ -3225,7 +3225,7 @@
         fprintf(stderr, "Out of memory\n");
         fatalError();
     }
-    o = fopen(temp, "w");
+    o = fopen(temp, "wb");
     if (o == NULL) {
 	fprintf(stderr, "failed to open output file %s\n", temp);
 	fclose(f);