dav/sync.c

changeset 725
de3b2bb46492
parent 724
9c2f0072abed
child 734
b2cd82149116
--- a/dav/sync.c	Sat Jul 25 12:08:15 2020 +0200
+++ b/dav/sync.c	Sat Jul 25 13:15:04 2020 +0200
@@ -2158,14 +2158,14 @@
         ucx_map_cstr_remove(db->resources, local->path);
     }
     
-    ls_new = ucx_list_sort(ls_new, (cmp_func)resource_pathlen_cmp, NULL);
-    ls_modified = ucx_list_sort(ls_modified, (cmp_func)resource_pathlen_cmp, NULL);
-    ls_conflict = ucx_list_sort(ls_conflict, (cmp_func)resource_pathlen_cmp, NULL);
-    ls_update = ucx_list_sort(ls_update, (cmp_func)resource_pathlen_cmp, NULL);
-    ls_delete = ucx_list_sort(ls_delete, (cmp_func)resource_pathlen_cmp, NULL);
-    ls_move = ucx_list_sort(ls_move, (cmp_func)resource_pathlen_cmp, NULL);
-    ls_copy = ucx_list_sort(ls_copy, (cmp_func)resource_pathlen_cmp, NULL);
-    ls_mkcol = ucx_list_sort(ls_mkcol, (cmp_func)resource_pathlen_cmp, NULL);
+    ls_new = ucx_list_sort(ls_new, (cmp_func)resource_path_cmp, NULL);
+    ls_modified = ucx_list_sort(ls_modified, (cmp_func)resource_path_cmp, NULL);
+    ls_conflict = ucx_list_sort(ls_conflict, (cmp_func)resource_path_cmp, NULL);
+    ls_update = ucx_list_sort(ls_update, (cmp_func)resource_path_cmp, NULL);
+    ls_delete = ucx_list_sort(ls_delete, (cmp_func)resource_path_cmp, NULL);
+    ls_move = ucx_list_sort(ls_move, (cmp_func)resource_path_cmp, NULL);
+    ls_copy = ucx_list_sort(ls_copy, (cmp_func)resource_path_cmp, NULL);
+    ls_mkcol = ucx_list_sort(ls_mkcol, (cmp_func)resource_path_cmp, NULL);
     
     if(outgoing) {
         print_outgoing(
@@ -3391,6 +3391,11 @@
     }
 }
 
+int resource_path_cmp(LocalResource *res1, LocalResource *res2, void *n) {
+    return strcmp(res1->path, res2->path);
+}
+
+
 DavResource *versioning_simple_find(DavResource *res, const char *version) {
     char *vcol_href = dav_get_string_property_ns(res, DAV_NS, VERSION_PATH_PROPERTY);
     if(!vcol_href) {

mercurial