summaryrefslogtreecommitdiff
path: root/plugins/PluginUpdater/src/unzipfile.cpp
diff options
context:
space:
mode:
authorTobias Weimer <wishmaster51@googlemail.com>2013-12-08 17:21:38 +0000
committerTobias Weimer <wishmaster51@googlemail.com>2013-12-08 17:21:38 +0000
commit234b9ad1ccfa557306cd5ec488ec47c78cdf0cc8 (patch)
treea59e8ad42cd1e4d7887e0f2c4cac3d6fd977f613 /plugins/PluginUpdater/src/unzipfile.cpp
parent34a4eb364a9f9db66c56153e93eb9ab70e0f670b (diff)
try to fix installing plugins which have been deselected
git-svn-id: http://svn.miranda-ng.org/main/trunk@7087 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/PluginUpdater/src/unzipfile.cpp')
-rw-r--r--plugins/PluginUpdater/src/unzipfile.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/plugins/PluginUpdater/src/unzipfile.cpp b/plugins/PluginUpdater/src/unzipfile.cpp
index 6517299d04..5ae9989053 100644
--- a/plugins/PluginUpdater/src/unzipfile.cpp
+++ b/plugins/PluginUpdater/src/unzipfile.cpp
@@ -45,21 +45,19 @@ void BackupFile(TCHAR *ptszSrcFileName, TCHAR *ptszBackFileName)
SafeMoveFile(ptszSrcFileName, ptszBackFileName);
}
-bool extractCurrentFile(unzFile uf, TCHAR *ptszDestPath, TCHAR *ptszBackPath)
+bool extractCurrentFile(unzFile uf, TCHAR *ptszDestPath, TCHAR *ptszBackPath, bool ch)
{
- int err = UNZ_OK;
unz_file_info64 file_info;
- char filename[MAX_PATH];
- char buf[8192];
+ char filename[MAX_PATH], buf[8192];
- err = unzGetCurrentFileInfo64(uf, &file_info, filename, sizeof(filename), buf, sizeof(buf), NULL, 0);
+ int err = unzGetCurrentFileInfo64(uf, &file_info, filename, sizeof(filename), buf, sizeof(buf), NULL, 0);
if (err != UNZ_OK)
return false;
for (char *p = strchr(filename, '/'); p; p = strchr(p+1, '/'))
*p = '\\';
- if (!db_get_b(NULL, MODNAME "Files", StrToLower(ptrA(mir_strdup(filename))), true))
+ if (ch && !db_get_b(NULL, MODNAME "Files", StrToLower(ptrA(mir_strdup(filename))), 1))
return true;
TCHAR tszDestFile[MAX_PATH], tszBackFile[MAX_PATH];
@@ -123,7 +121,7 @@ bool extractCurrentFile(unzFile uf, TCHAR *ptszDestPath, TCHAR *ptszBackPath)
return true;
}
-bool unzip(const TCHAR *ptszZipFile, TCHAR *ptszDestPath, TCHAR *ptszBackPath)
+bool unzip(const TCHAR *ptszZipFile, TCHAR *ptszDestPath, TCHAR *ptszBackPath,bool ch)
{
bool bResult = true;
@@ -133,7 +131,7 @@ bool unzip(const TCHAR *ptszZipFile, TCHAR *ptszDestPath, TCHAR *ptszBackPath)
unzFile uf = unzOpen2_64(ptszZipFile, &ffunc);
if (uf) {
do {
- if ( !extractCurrentFile(uf, ptszDestPath, ptszBackPath))
+ if ( !extractCurrentFile(uf, ptszDestPath, ptszBackPath,ch))
bResult = false;
}
while (unzGoToNextFile(uf) == UNZ_OK);