# HG changeset patch # User Olaf Wintermann # Date 1712690904 -7200 # Node ID baf199df500e6c5af645040517c0230a4c9a921f # Parent 8e6d8f0327cf6376a012c28a181dc26ab209272c don't store directories with a trailing path separator in the sync db diff -r 8e6d8f0327cf -r baf199df500e dav/sync.c --- a/dav/sync.c Sun Apr 07 10:26:25 2024 +0200 +++ b/dav/sync.c Tue Apr 09 21:28:24 2024 +0200 @@ -840,7 +840,7 @@ DavResource *res = cxListAt(stack, 0); cxListRemove(stack, 0); - while(res) { + while(res) { DavBool res_filtered = FALSE; if (res_matches_dir_filter(dir, res->path)) { res_filtered = TRUE; @@ -1084,7 +1084,6 @@ CxList *rmdirs = cxLinkedListCreate(cxDefaultAllocator, (cx_compare_func)resource_pathlen_cmp, CX_STORE_POINTERS); i = cxMapIteratorValues(lres_removed); - LocalResource *removed_res; cx_foreach(LocalResource *, removed_res, i) { if(sync_shutdown) { break; @@ -2184,7 +2183,7 @@ } } - + // we need a fast file lookup map later to detect deleted files cxMapPut(resources_map, cx_hash_key_str(local_res->path), local_res); @@ -3075,11 +3074,12 @@ res->uid = s.st_uid; res->gid = s.st_gid; res->last_modified = s.st_mtime; + res->path = strdup(path); if(!S_ISDIR(s.st_mode)) { - res->path = strdup(path); + //res->path = strdup(path); res->size = s.st_size; } else { - res->path = util_concat_path(path, "/"); + //res->path = util_concat_path(path, "/"); res->isdirectory = 1; }