From 46bd23bb19193e78e544d07a721e96548a7ab60a Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 30 Sep 2012 14:50:03 +0000 Subject: fix for DLLs with the trailing W in names git-svn-id: http://svn.miranda-ng.org/main/trunk@1729 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/PluginUpdater/src/Scanner.cpp | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'plugins/PluginUpdater/src/Scanner.cpp') diff --git a/plugins/PluginUpdater/src/Scanner.cpp b/plugins/PluginUpdater/src/Scanner.cpp index 6f0a266296..e0a4952b47 100644 --- a/plugins/PluginUpdater/src/Scanner.cpp +++ b/plugins/PluginUpdater/src/Scanner.cpp @@ -123,15 +123,16 @@ static void ScanFolder(const TCHAR *tszFolder, const TCHAR *tszBaseUrl, SERVLIST ServListEntry tmp = {NULL, key}; ServListEntry *item = hashes.find(&tmp); if (item == NULL) { - size_t cbKeyLen = _tcslen(key)-1; - if (key[cbKeyLen] != 'w') + TCHAR *p = _tcschr(key, '.'); + if (p[-1] != 'w') continue; - key[cbKeyLen] = 0; + int iPos = int(p - key)-1; + strdel(p-1, 1); if ((item = hashes.find(&tmp)) == NULL) continue; - ffd.cFileName[cbKeyLen] = 0; + strdel(tszNewName+iPos, 1); } size_t cbLenOrig = _tcslen(item->m_name); @@ -157,11 +158,15 @@ static void ScanFolder(const TCHAR *tszFolder, const TCHAR *tszBaseUrl, SERVLIST // Compare versions if ( strcmp(szMyHash, szSiteHash)) { // Yeah, we've got new version. FILEINFO *FileInfo = new FILEINFO; - _tcscpy(FileInfo->tszNewName, tszNewName); - if (tszNewName[0]) - _tcscpy(FileInfo->tszOldName, ffd.cFileName); - else - _tcscpy(FileInfo->tszOldName, tszMask); // + _tcscpy(FileInfo->tszOldName, ffd.cFileName); + if (tszNewName[0] == 0) { + FileInfo->bDeleteOnly = TRUE; + _tcscpy(FileInfo->tszNewName, tszMask); + } + else { + FileInfo->bDeleteOnly = FALSE; + _tcscpy(FileInfo->tszNewName, tszNewName); + } *pExt = 0; mir_sntprintf(FileInfo->File.tszDiskPath, SIZEOF(FileInfo->File.tszDiskPath), _T("%s\\Temp\\%s.zip"), tszRoot, tszNewName); -- cgit v1.2.3