summaryrefslogtreecommitdiff
path: root/plugins/PluginUpdater/src/Scanner.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-08-15 10:48:34 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-08-15 10:48:34 +0000
commit7ad7dc2a281fbe2442bf3e8efe594e4ffdd0c5de (patch)
treef00ceb65e062806bf20a7db84e628ffa8d0b85d6 /plugins/PluginUpdater/src/Scanner.cpp
parent5a91616243eb2dba33ac92849cb2702091641306 (diff)
- folder's path isn't updated upon change in Options;
- plugin's own directory should be skipped during scan; - minor code optimization git-svn-id: http://svn.miranda-ng.org/main/trunk@1464 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/PluginUpdater/src/Scanner.cpp')
-rw-r--r--plugins/PluginUpdater/src/Scanner.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/plugins/PluginUpdater/src/Scanner.cpp b/plugins/PluginUpdater/src/Scanner.cpp
index 83ab6a5396..0c267602c8 100644
--- a/plugins/PluginUpdater/src/Scanner.cpp
+++ b/plugins/PluginUpdater/src/Scanner.cpp
@@ -52,8 +52,11 @@ typedef OBJLIST<ServListEntry> SERVLIST;
static void ScanFolder(const TCHAR* tszFolder, const TCHAR* tszBaseUrl, SERVLIST& hashes, OBJLIST<FILEINFO>* UpdateFiles)
{
- TCHAR tszMask[MAX_PATH], tszFileTemp[MAX_PATH];
- mir_sntprintf(tszFileTemp, SIZEOF(tszFileTemp), _T("%s\\Temp"), tszRoot);
+ // skip updater's own folder
+ if ( !_tcsicmp(tszFolder, tszRoot))
+ return;
+
+ TCHAR tszMask[MAX_PATH];
mir_sntprintf(tszMask, SIZEOF(tszMask), _T("%s\\*"), tszFolder);
WIN32_FIND_DATA ffd;
@@ -107,7 +110,7 @@ static void ScanFolder(const TCHAR* tszFolder, const TCHAR* tszBaseUrl, SERVLIST
_tcscpy(FileInfo->tszDescr, ffd.cFileName);
*pExt = 0;
- mir_sntprintf(FileInfo->File.tszDiskPath, SIZEOF(FileInfo->File.tszDiskPath), _T("%s\\%s.zip"), tszFileTemp, ffd.cFileName);
+ mir_sntprintf(FileInfo->File.tszDiskPath, SIZEOF(FileInfo->File.tszDiskPath), _T("%s\\Temp\\%s.zip"), tszRoot, ffd.cFileName);
mir_sntprintf(FileInfo->File.tszDownloadURL, SIZEOF(FileInfo->File.tszDownloadURL), _T("%s/%s"), tszBaseUrl, item->m_name);
if ((pExt = _tcsrchr(FileInfo->File.tszDownloadURL, '.')) != NULL)