summaryrefslogtreecommitdiff
path: root/plugins/PluginUpdater/src/Scanner.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-05-21 17:47:19 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-05-21 17:47:19 +0000
commitc7fb09d2e8b91f74052f51e442cc8921ed8b3ec6 (patch)
tree4fe98a6a1e1cb5062532962ad4fbc008d26d05bf /plugins/PluginUpdater/src/Scanner.cpp
parent6e9eee484c789415aa34066b817232bd39d3ac0e (diff)
PluginUpdater now updates also language packs
git-svn-id: http://svn.miranda-ng.org/main/trunk@4783 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/PluginUpdater/src/Scanner.cpp')
-rw-r--r--plugins/PluginUpdater/src/Scanner.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/plugins/PluginUpdater/src/Scanner.cpp b/plugins/PluginUpdater/src/Scanner.cpp
index f013d0dfe4..eebd69cd62 100644
--- a/plugins/PluginUpdater/src/Scanner.cpp
+++ b/plugins/PluginUpdater/src/Scanner.cpp
@@ -145,6 +145,18 @@ static bool CheckFileRename(const TCHAR *ptszOldName, TCHAR *pNewName)
typedef OBJLIST<ServListEntry> SERVLIST;
+static bool isValidExtension(const TCHAR *ptszFileName)
+{
+ const TCHAR *pExt = _tcsrchr(ptszFileName, '.');
+ if (pExt == NULL)
+ return false;
+
+ if ( !_tcsicmp(pExt, _T(".dll"))) return true;
+ if ( !_tcsicmp(pExt, _T(".exe"))) return true;
+ if ( !_tcsicmp(pExt, _T(".txt"))) return true;
+ return false;
+}
+
static void ScanFolder(const TCHAR *tszFolder, size_t cbBaseLen, int level, const TCHAR *tszBaseUrl, SERVLIST& hashes, OBJLIST<FILEINFO> *UpdateFiles)
{
// skip updater's own folder
@@ -174,9 +186,7 @@ static void ScanFolder(const TCHAR *tszFolder, size_t cbBaseLen, int level, cons
continue;
}
- TCHAR *pExt = _tcsrchr(ffd.cFileName, '.');
- if (pExt == NULL) continue;
- if ( _tcsicmp(pExt, _T(".dll")) && _tcsicmp(pExt, _T(".exe")))
+ if ( !isValidExtension(ffd.cFileName))
continue;
// calculate the current file's relative name and store it into tszNewName