summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-08-06 20:52:37 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-08-06 20:52:37 +0000
commit97ecd2b560357a1c7756d7b93d0b820f63071080 (patch)
treea1a1ed6c5ea976b7699003388c69bb2fd45f6e7e
parent4021c096c2acf83f4671edbb4e212796bd662491 (diff)
fix for the repetitive update
git-svn-id: http://svn.miranda-ng.org/main/trunk@1388 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--plugins/PluginUpdater/src/Scanner.cpp8
-rw-r--r--plugins/PluginUpdater/src/unzipfile.cpp1
2 files changed, 5 insertions, 4 deletions
diff --git a/plugins/PluginUpdater/src/Scanner.cpp b/plugins/PluginUpdater/src/Scanner.cpp
index 20cc98ea40..e8cb5c2f99 100644
--- a/plugins/PluginUpdater/src/Scanner.cpp
+++ b/plugins/PluginUpdater/src/Scanner.cpp
@@ -38,9 +38,9 @@ typedef pair<string, string> hashItem;
static void ScanFolder(const TCHAR* tszFolder, const TCHAR* tszBaseUrl, hashMap& hashes, vector<FILEINFO>* UpdateFiles)
{
- TCHAR tszMask[MAX_PATH], tszFileBack[MAX_PATH];
+ TCHAR tszMask[MAX_PATH], tszFileTemp[MAX_PATH];
mir_sntprintf(tszMask, SIZEOF(tszMask), _T("%s\\*"), tszFolder);
- mir_sntprintf(tszFileBack, SIZEOF(tszFileBack), _T("%s\\Temp"), tszRoot);
+ mir_sntprintf(tszFileTemp, SIZEOF(tszFileTemp), _T("%s\\Temp"), tszRoot);
WIN32_FIND_DATA ffd;
HANDLE hFind = FindFirstFile(tszMask, &ffd);
@@ -91,7 +91,7 @@ static void ScanFolder(const TCHAR* tszFolder, const TCHAR* tszBaseUrl, hashMap&
mir_sntprintf(FileInfo.File.tszDownloadURL, SIZEOF(FileInfo.File.tszDownloadURL), _T("%s/%s.zip"), tszBaseUrl, ffd.cFileName);
_tcslwr(FileInfo.File.tszDownloadURL);
- mir_sntprintf(FileInfo.File.tszDiskPath, SIZEOF(FileInfo.File.tszDiskPath), _T("%s\\%s.zip"), tszFileBack, ffd.cFileName);
+ mir_sntprintf(FileInfo.File.tszDiskPath, SIZEOF(FileInfo.File.tszDiskPath), _T("%s\\%s.zip"), tszFileTemp, ffd.cFileName);
UpdateFiles->push_back(FileInfo);
} // end compare versions
@@ -108,7 +108,7 @@ static void __stdcall LaunchDialog(void* param)
static void CheckUpdates(void *)
{
- TCHAR tszBuff[2048] = {0}, /*tszFileInfo[30] = {0},*/ tszTmpIni[MAX_PATH] = {0};
+ TCHAR tszBuff[2048] = {0}, tszTmpIni[MAX_PATH] = {0};
char szKey[64] = {0};
DBVARIANT dbVar = {0};
diff --git a/plugins/PluginUpdater/src/unzipfile.cpp b/plugins/PluginUpdater/src/unzipfile.cpp
index fcafc5b17c..dc55dfca43 100644
--- a/plugins/PluginUpdater/src/unzipfile.cpp
+++ b/plugins/PluginUpdater/src/unzipfile.cpp
@@ -59,6 +59,7 @@ bool extractCurrentFile(unzFile uf, TCHAR* ptszDestPath, TCHAR* ptszBackPath)
if (err != UNZ_OK)
return false;
+ DeleteFile(tszBackFile);
MoveFile(tszDestFile, tszBackFile);
HANDLE hFile = CreateFile(tszDestFile, GENERIC_WRITE, FILE_SHARE_WRITE, 0,