summaryrefslogtreecommitdiff
path: root/updater/xmldata.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'updater/xmldata.cpp')
-rw-r--r--updater/xmldata.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/updater/xmldata.cpp b/updater/xmldata.cpp
index d8017a5..e8b1f3a 100644
--- a/updater/xmldata.cpp
+++ b/updater/xmldata.cpp
@@ -427,6 +427,7 @@ int FindFileID(const char *name, const Category cat, UpdateList *update_list) {
// ignore case in name
int id = -1;
+ char *version = NULL;
ezxml_t root = ezxml_get(doc[cat], "channel", 0, "item", -1);
while (root) {
@@ -434,8 +435,16 @@ int FindFileID(const char *name, const Category cat, UpdateList *update_list) {
if (_stricmp(title, name) == 0) {
const char* subcategory = ezxml_txt(ezxml_child(root, "subcategory"));
if (strcmp(subcategory, "Archived")) {
- id = atoi(ezxml_txt(ezxml_child(root, "id")));
- if (id) break; else id = -1;
+ int id1 = atoi(ezxml_txt(ezxml_child(root, "id")));
+ if (id1)
+ {
+ char *version1 = ezxml_txt(ezxml_child(root, "version"));
+ if (!version || (version1 && VersionLess(version, version1)))
+ {
+ version = version1;
+ id = id1;
+ }
+ }
}
}
root = ezxml_next(root);