summaryrefslogtreecommitdiff
path: root/plugins/Db_autobackups
diff options
context:
space:
mode:
authorMikalaiR <nikolay.romanovich@narod.ru>2016-02-09 18:24:44 +0000
committerMikalaiR <nikolay.romanovich@narod.ru>2016-02-09 18:24:44 +0000
commit56c7e019fd21d3c1d84491bdf6219747702b4b47 (patch)
tree5c311f5d6431b94331cb5ff4eb5087739e103b51 /plugins/Db_autobackups
parentbb4b36ea7849f1ff005798514095a2420deca305 (diff)
small fixes
git-svn-id: http://svn.miranda-ng.org/main/trunk@16254 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Db_autobackups')
-rw-r--r--plugins/Db_autobackups/src/backup.cpp6
1 files changed, 3 insertions, 3 deletions
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<std::string> 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);