diff options
author | George Hazan <george.hazan@gmail.com> | 2012-09-30 14:50:03 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-09-30 14:50:03 +0000 |
commit | 46bd23bb19193e78e544d07a721e96548a7ab60a (patch) | |
tree | 15f5848c0766f231bc85b07c57e8821b34fe66ff /plugins/PluginUpdater/src/Scanner.cpp | |
parent | 82ea016e57d36a1e75e57529f8f5dfdd2ac39b63 (diff) |
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
Diffstat (limited to 'plugins/PluginUpdater/src/Scanner.cpp')
-rw-r--r-- | plugins/PluginUpdater/src/Scanner.cpp | 23 |
1 files changed, 14 insertions, 9 deletions
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);
|