diff --git a/lib/mu-store-priv.hh b/lib/mu-store-priv.hh index 3990f420..68897045 100644 --- a/lib/mu-store-priv.hh +++ b/lib/mu-store-priv.hh @@ -29,6 +29,7 @@ #include #include #include +#include #include "mu-store.h" #include "mu-contacts.h" @@ -64,6 +65,11 @@ public: check_set_version (); if (contacts_path) { + /* when rebuilding, attempt to clear the + * contacts path */ + if (rebuild && access (contacts_path, W_OK) == 0) + (void)unlink (contacts_path); + _contacts = mu_contacts_new (contacts_path); if (!_contacts) throw MuStoreError (MU_ERROR_FILE,