From d0580040b51b6c4803e0f61863bd985c382370e9 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 26 Jan 2014 15:22:35 +0000 Subject: fix for creating backup files in dbchecker git-svn-id: http://svn.miranda-ng.org/main/trunk@7906 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Db3x_mmap/src/init.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'plugins/Db3x_mmap/src/init.cpp') diff --git a/plugins/Db3x_mmap/src/init.cpp b/plugins/Db3x_mmap/src/init.cpp index 4938ae9cba..e9810fabe4 100644 --- a/plugins/Db3x_mmap/src/init.cpp +++ b/plugins/Db3x_mmap/src/init.cpp @@ -72,7 +72,7 @@ static MIDatabase* LoadDatabase(const TCHAR *profile) // set the memory, lists & UTF8 manager mir_getLP( &pluginInfo ); - std::auto_ptr db( new CDb3Mmap(profile)); + std::auto_ptr db(new CDb3Mmap(profile)); if (db->Load(false) != ERROR_SUCCESS) return NULL; @@ -90,18 +90,14 @@ static int UnloadDatabase(MIDatabase* db) MIDatabaseChecker* CheckDb(const TCHAR* profile, int *error) { std::auto_ptr db(new CDb3Mmap(profile)); - if (db->Load(false) != ERROR_SUCCESS) { + if (db->Load(true) != ERROR_SUCCESS) { *error = EGROKPRF_CANTREAD; return NULL; } - int chk = db->CheckDbHeaders(); - if (chk != ERROR_SUCCESS) { - *error = chk; + if (*error = db->PrepareCheck()) return NULL; - } - *error = 0; return db.release(); } -- cgit v1.2.3