dav now opens files in binary mode

Tue, 30 Dec 2014 13:24:03 +0100

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Tue, 30 Dec 2014 13:24:03 +0100
changeset 72
aac29f2e8030
parent 71
c9aff0a0093d
child 73
41e88442ad4e

dav now opens files in binary mode

dav/main.c file | annotate | diff | comparison | revisions
dav/sync.c file | annotate | diff | comparison | revisions
mingw.mk file | annotate | diff | comparison | revisions
--- 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;
--- 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);
--- 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
 

mercurial