dav/sync.c

changeset 66
f8c1f685e08e
parent 65
d4077e8175f3
child 68
f6d3db6113d3
--- a/dav/sync.c	Sun Nov 09 11:30:24 2014 +0100
+++ b/dav/sync.c	Sun Nov 09 14:33:23 2014 +0100
@@ -501,8 +501,10 @@
     UcxMapIterator i = ucx_map_iterator(db->resources);
     LocalResource *local;
     UCX_MAP_FOREACH(key, local, i) {
-        if(sync_delete_remote_resource(sn, local)) {
-            ucx_map_cstr_put(lclres, local->path, local);
+        if (!res_matches_filter(dir, local->path+1)) {
+            if(sync_delete_remote_resource(sn, local)) {
+                ucx_map_cstr_put(lclres, local->path, local);
+            }
         }
     }
     ucx_map_free(db->resources);
@@ -720,7 +722,7 @@
     }
     
     int ret = 0;
-    if(!strcmp(etag, local_res->etag)) {
+    if(etag && !strcmp(etag, local_res->etag)) {
         // local resource metadata == remote resource metadata
         // resource can be deleted
         printf("delete: %s\n", res->path);

mercurial