Wed, 23 Oct 2019 20:24:40 +0200
fix dav-sync add-tag in case a file is not in the db
dav/sync.c | file | annotate | diff | comparison | revisions |
--- a/dav/sync.c Wed Oct 23 20:10:55 2019 +0200 +++ b/dav/sync.c Wed Oct 23 20:24:40 2019 +0200 @@ -4955,7 +4955,13 @@ return -1; } + LocalResource *newres = NULL; LocalResource *localres = ucx_map_cstr_get(db->resources, file.path); + if(!localres) { + newres = calloc(1, sizeof(LocalResource)); + newres->path = strdup(file.path); + localres = newres; + } UcxList *tags = NULL; DavBool store_tags = FALSE; @@ -5019,6 +5025,10 @@ } } + if(newres) { + local_resource_free(newres); + } + // store db if(store_db(db, file.dir->database, file.dir->db_settings)) { fprintf(stderr, "Cannot store sync db\n");