# HG changeset patch # User Olaf Wintermann # Date 1419942243 -3600 # Node ID aac29f2e80300f9c7d43de9837cc70705c4571aa # Parent c9aff0a0093d8e838ff1290be92eb18ca218107a dav now opens files in binary mode diff -r c9aff0a0093d -r aac29f2e8030 dav/main.c --- a/dav/main.c Mon Dec 15 10:01:09 2014 +0100 +++ b/dav/main.c Tue Dec 30 13:24:03 2014 +0100 @@ -624,7 +624,7 @@ return 0; } - FILE *fout = !strcmp(out, "-") ? stdout : fopen(out, "w"); + FILE *fout = !strcmp(out, "-") ? stdout : fopen(out, "wb"); if(!fout) { fprintf(stderr, "cannot open output file\n"); return -1; @@ -721,7 +721,7 @@ /* * use stdin if the input file is - */ - FILE *in = fopen(file, "r"); + FILE *in = fopen(file, "rb"); if(!in) { fprintf(stderr, "cannot open input file\n"); return -1; diff -r c9aff0a0093d -r aac29f2e8030 dav/sync.c --- a/dav/sync.c Mon Dec 15 10:01:09 2014 +0100 +++ b/dav/sync.c Tue Dec 30 13:24:03 2014 +0100 @@ -303,7 +303,7 @@ ret = -1; } } else { - FILE *out = fopen(local_path, "w"); + FILE *out = fopen(local_path, "wb"); if(!out) { fprintf(stderr, "Cannot open output file: %s\n", local_path); free(local_path); @@ -669,7 +669,7 @@ int sync_put_resource(SyncDirectory *dir, DavResource *res, LocalResource *local) { char *local_path = util_concat_path(dir->path, res->path); - FILE *in = fopen(local_path, "r"); + FILE *in = fopen(local_path, "rb"); if(!in) { fprintf(stderr, "Cannot open file %s\n", local_path); free(local_path); diff -r c9aff0a0093d -r aac29f2e8030 mingw.mk --- a/mingw.mk Mon Dec 15 10:01:09 2014 +0100 +++ b/mingw.mk Tue Dec 30 13:24:03 2014 +0100 @@ -31,9 +31,9 @@ AR = ar RM = rm -CFLAGS = -std=gnu99 -g -c +CFLAGS = -std=gnu99 -c -O2 -m64 COFLAGS = -o -LDFLAGS = -lregex +LDFLAGS = LOFLAGS = -o ARFLAGS = -r RMFLAGS = -f @@ -43,5 +43,5 @@ APP_EXT = .exe DAV_CFLAGS = -I /mingw/include/libxml2 -DAV_LDFLAGS = -lcurl -lssl -lcrypto -lxml2 +DAV_LDFLAGS = -m64 -lcurl -lxml2 -lssl -lcrypto -lws2_32 -lgdi32 -lregex