mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-03-10 08:58:16 +03:00
Trying to fix CR/LF troubles, Daniel
This commit is contained in:
parent
73c0f71a58
commit
cfbb0dd89a
@ -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 @@ static int checkTestFile(const char *filename) {
|
||||
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];
|
||||
|
||||
|
22
runtest.c
22
runtest.c
@ -1631,7 +1631,7 @@ saxParseTest(const char *filename, const char *result,
|
||||
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 @@ streamProcessTest(const char *filename, const char *result, const char *err,
|
||||
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 @@ xpathCommonTest(const char *filename, const char *result,
|
||||
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 @@ xmlidDocTest(const char *filename,
|
||||
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 @@ uriCommonTest(const char *filename,
|
||||
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 @@ schemasOneTest(const char *sch,
|
||||
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 @@ rngOneTest(const char *sch,
|
||||
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 @@ patternTest(const char *filename,
|
||||
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 @@ patternTest(const char *filename,
|
||||
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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user