From 2021d20d84bb791d7a29faf80a6dbda3a40192d9 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 30 Nov 2012 19:15:42 +0000 Subject: adaptaition for new hashes.txt format git-svn-id: http://svn.miranda-ng.org/main/trunk@2569 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/PluginUpdater/src/Scanner.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'plugins/PluginUpdater/src') diff --git a/plugins/PluginUpdater/src/Scanner.cpp b/plugins/PluginUpdater/src/Scanner.cpp index 9a704f49e4..07394110d0 100644 --- a/plugins/PluginUpdater/src/Scanner.cpp +++ b/plugins/PluginUpdater/src/Scanner.cpp @@ -35,9 +35,10 @@ static bool Exists(LPCTSTR strName) struct ServListEntry { - ServListEntry(const char* _name, const char* _hash) : + ServListEntry(const char* _name, const char* _hash, DWORD _crc) : m_name( mir_a2t(_name)), - m_bNeedFree(true) + m_bNeedFree(true), + m_crc(_crc) { strncpy(m_szHash, _hash, sizeof(m_szHash)); } @@ -57,6 +58,7 @@ struct ServListEntry TCHAR *m_name; char m_szHash[32+1]; bool m_bNeedFree; + DWORD m_crc; }; static int CompareHashes(const ServListEntry *p1, const ServListEntry *p2) @@ -272,7 +274,16 @@ static void CheckUpdates(void *) continue; _strlwr(p); - hashes.insert(new ServListEntry(str, p)); + + DWORD dwCrc32; + char *p1 = strchr(p, ' '); + if (p1 == NULL) + dwCrc32 = 0; + else { + *p1++ = 0; + sscanf(p1, "%08x", &dwCrc32); + } + hashes.insert(new ServListEntry(str, p, dwCrc32)); } fclose(fp); DeleteFile(tszTmpIni); -- cgit v1.2.3