dav/sync.c

changeset 560
a816e805e5db
parent 559
ba54fc8abdf1
child 561
5e6df4f502d3
--- a/dav/sync.c	Tue Apr 09 18:23:23 2019 +0200
+++ b/dav/sync.c	Wed Apr 10 11:03:37 2019 +0200
@@ -867,8 +867,8 @@
         DavBool nochange = FALSE;
         char *content_hash = sync_get_content_hash(res);
         
-        if(content_hash || local->hash) {
-            if(!nullstrcmp(content_hash, local->hash)) {
+        if(content_hash && local->hash) {
+            if(!strcmp(content_hash, local->hash)) {
                 nochange = TRUE;
             }
         } else if(local->etag) {
@@ -1141,8 +1141,9 @@
     }
     fclose(out);
     
-    if(issplit) {
+    if(issplit || dir->hashing) {
         if(truncate_file >= 0) {
+            // only true if issplit is true
             if(truncate(local_path, truncate_file)) {
                 perror("truncate");
             }
@@ -1325,6 +1326,7 @@
                 } else {
                     LocalResource *conflict = calloc(1, sizeof(LocalResource));
                     conflict->path = strdup(new_res_path.ptr);
+                    conflict->conflict_source = strdup(path);
                     ucx_map_cstr_put(db->conflict, new_res_path.ptr, conflict);
                 }
             }

mercurial