# HG changeset patch # User Olaf Wintermann # Date 1468404184 -7200 # Node ID f5921d151c2915f27f63b3faff48fcc88dd15aa6 # Parent a39be87d34d4af108dec0fa4c3541cde6e6a7424 fixed SyncDatabase initialization diff -r a39be87d34d4 -r f5921d151c29 dav/db.c --- a/dav/db.c Wed Jul 13 10:00:48 2016 +0200 +++ b/dav/db.c Wed Jul 13 12:03:04 2016 +0200 @@ -59,7 +59,7 @@ xmlDocSetRootElement(doc, root); if(xmlSaveFormatFileEnc(db_file, doc, "UTF-8", 1) != -1) { db->resources = ucx_map_new(2048); - //db->remove = ucx_map_new(8); + db->conflict = ucx_map_new(16); } else { free(db); db = NULL; @@ -71,7 +71,6 @@ free(db_file); db->resources = ucx_map_new(2048); - //db->remove = ucx_map_new(16); db->conflict = ucx_map_new(16); int error = 0; while(xmlTextReaderRead(reader)) { @@ -166,7 +165,7 @@ } } - if(!res->path || res->last_modified == 0) { + if(!res->path) { // TODO: free res return NULL; } else { diff -r a39be87d34d4 -r f5921d151c29 dav/sync.c --- a/dav/sync.c Wed Jul 13 10:00:48 2016 +0200 +++ b/dav/sync.c Wed Jul 13 12:03:04 2016 +0200 @@ -225,7 +225,6 @@ SyncDatabase *db = load_db(dir->database); if(!db) { fprintf(stderr, "Cannot load database file: %s\n", dir->database); - destroy_db(db); return -1; } remove_deleted_conflicts(dir, db);