1
0
mirror of https://github.com/gryf/wmaker.git synced 2026-01-09 15:24:12 +01:00

patch to add binary mode on opening files (for Windows+Cygwin compatibility).

This commit is contained in:
dan
2002-09-15 20:37:41 +00:00
parent 3fc803c0d8
commit 92b012e800
20 changed files with 41 additions and 34 deletions

View File

@@ -15,10 +15,7 @@ INCLUDES = $(DFLAGS) -I$(top_srcdir)/WINGs -I$(top_srcdir)/wrlib \
@HEADER_SEARCH_PATH@ \
-DETCDIR=\"sysconfdir\" -DDATADIR=\"pkgdatadir\"
# X_EXTRA_LIBS is for libproplist in systems that need -lsocket
# remove after we require lPL 0.10.2 which automatically resolves its
# library dependancies using the libPropList.la file
liblist= @LIBRARY_SEARCH_PATH@ @X_EXTRA_LIBS@ @INTLIBS@
liblist= @LIBRARY_SEARCH_PATH@ @INTLIBS@
wdwrite_LDADD = $(top_builddir)/WINGs/libWUtil.a $(liblist)

View File

@@ -133,7 +133,7 @@ LoadJPEG(RContext *rc, char *file_name, int *width, int *height)
if (!canLoad(rc))
return None;
file = fopen(file_name, "r");
file = fopen(file_name, "rb");
if (!file) {
return None;
}

View File

@@ -595,7 +595,7 @@ readBlackBoxStyle(char *path)
char buffer[128], char token[128];
WMPropList *style, *p;
f = fopen(path, "r");
f = fopen(path, "rb");
if (!f) {
perror(path);
return NULL;

View File

@@ -296,7 +296,7 @@ Bool copyAllFiles(char *gsdir)
sprintf(path, "%s/USER_FILES", DATADIR);
f = fopen(path, "r");
f = fopen(path, "rb");
while (!feof(f)) {
if (!fgets(file, 255, f)) {
break;
@@ -319,7 +319,7 @@ Bool copyAllFiles(char *gsdir)
sprintf(path, "%s/USER_FILES", ETCDIR);
f = fopen(path, "r");
f = fopen(path, "rb");
while (!feof(f)) {
if (!fgets(path, 255, f)) {
break;

View File

@@ -120,7 +120,7 @@ main(int argc, char **argv)
}
}
if (filename) {
file = fopen(filename, "r");
file = fopen(filename, "rb");
if (!file) {
char line[1024];
sprintf(line, "%s: could not open \"%s\"", argv[0], filename);