summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-11-30 19:15:42 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-11-30 19:15:42 +0000
commit2021d20d84bb791d7a29faf80a6dbda3a40192d9 (patch)
tree3cccc6dbb9a40e89801a525d80ac9aceb7fa80ce /plugins
parent19642942fd8e581f1de04961a85af87b98b9d9c7 (diff)
adaptaition for new hashes.txt format
git-svn-id: http://svn.miranda-ng.org/main/trunk@2569 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins')
-rw-r--r--plugins/PluginUpdater/src/Scanner.cpp17
1 files changed, 14 insertions, 3 deletions
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);