# HG changeset patch # User Olaf Wintermann # Date 1595675704 -7200 # Node ID de3b2bb46492a5daf3a0f6e02a6519221d83c5cb # Parent 9c2f0072abed2889761d4134f27dc5a7eb589f60 fix outgoing list sort diff -r 9c2f0072abed -r de3b2bb46492 dav/sync.c --- 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) { diff -r 9c2f0072abed -r de3b2bb46492 dav/sync.h --- a/dav/sync.h Sat Jul 25 12:08:15 2020 +0200 +++ b/dav/sync.h Sat Jul 25 13:15:04 2020 +0200 @@ -176,6 +176,7 @@ size_t resource_get_blocksize(SyncDirectory *dir, LocalResource *local, DavResource *res, off_t filesize); int resource_pathlen_cmp(LocalResource *res1, LocalResource *res2, void *n); +int resource_path_cmp(LocalResource *res1, LocalResource *res2, void *n); DavResource *versioning_simple_find(DavResource *res, const char *version); DavResource *versioning_deltav_find(DavResource *res, const char *version);