From 56c7e019fd21d3c1d84491bdf6219747702b4b47 Mon Sep 17 00:00:00 2001 From: MikalaiR Date: Tue, 9 Feb 2016 18:24:44 +0000 Subject: small fixes git-svn-id: http://svn.miranda-ng.org/main/trunk@16254 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Db_autobackups/src/backup.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'plugins/Db_autobackups/src/backup.cpp') diff --git a/plugins/Db_autobackups/src/backup.cpp b/plugins/Db_autobackups/src/backup.cpp index c32e30fca0..c9415a1a2d 100644 --- a/plugins/Db_autobackups/src/backup.cpp +++ b/plugins/Db_autobackups/src/backup.cpp @@ -78,11 +78,10 @@ TCHAR* DoubleSlash(TCHAR *sorce) return ret; } -bool MakeZip_Dir(LPCSTR szDir, LPCTSTR szDest, LPCSTR szDbName, HWND progress_dialog) +bool MakeZip_Dir(LPCSTR szDir, LPCTSTR szDest, LPCSTR /* szDbName */, HWND progress_dialog) { zipFile hZip = zipOpen2_64(szDest, APPEND_STATUS_CREATE, NULL, NULL); zip_fileinfo fi = { 0 }; - std::vector files; auto folder = fs::path(szDir); auto it = fs::recursive_directory_iterator(folder); HWND hProgBar = GetDlgItem(progress_dialog, IDC_PROGRESS); @@ -93,7 +92,7 @@ bool MakeZip_Dir(LPCSTR szDir, LPCTSTR szDest, LPCSTR szDbName, HWND progress_di if (!fs::is_directory(file) && !strstr(std::string(file).c_str(), _T2A(szDest))) { std::string filepath = file; - std::string rpath = filepath.substr(filepath.find(szDir) + mir_strlen(szDir)); + std::string rpath = filepath.substr(filepath.find(szDir) + mir_strlen(szDir) + 1); HANDLE hSrc; if (hSrc = CreateFile(_A2T(filepath.c_str()), GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)) @@ -107,6 +106,7 @@ bool MakeZip_Dir(LPCSTR szDir, LPCTSTR szDest, LPCSTR szDbName, HWND progress_di if (zipWriteInFileInZip(hZip, buf, dwRead) != ZIP_OK) break; } + zipCloseFileInZip(hZip); } i++; SendMessage(hProgBar, PBM_SETPOS, (WPARAM)(i % 100), 0); -- cgit v1.2.3