summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Weimer <wishmaster51@googlemail.com>2013-07-19 19:37:19 +0000
committerTobias Weimer <wishmaster51@googlemail.com>2013-07-19 19:37:19 +0000
commitaf5c37f6ef2b6b9b187226f1fbd5c01dca9b6586 (patch)
treeb3e20ca9e0f66e021fff003548b7ae03c7023a3a
parent09e8af8049cc4c28f2c434de6ddfddbce3c18ac4 (diff)
use the first link attribute instead of the last one (fixes #421)
git-svn-id: http://svn.miranda-ng.org/main/trunk@5423 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--plugins/NewsAggregator/Src/CheckFeed.cpp36
1 files changed, 15 insertions, 21 deletions
diff --git a/plugins/NewsAggregator/Src/CheckFeed.cpp b/plugins/NewsAggregator/Src/CheckFeed.cpp
index 9db5cd84da..4d73c75834 100644
--- a/plugins/NewsAggregator/Src/CheckFeed.cpp
+++ b/plugins/NewsAggregator/Src/CheckFeed.cpp
@@ -213,57 +213,51 @@ VOID CheckCurrentFeed(HANDLE hContact)
ClearText(string);
title = mir_tstrdup(string);
mir_free(string);
- continue;
}
- if (!lstrcmpi(xi.getName(itemval), _T("link"))) {
- TCHAR *string = mir_tstrdup(xi.getText(itemval));
- ClearText(string);
- link = mir_tstrdup(string);
- mir_free(string);
- continue;
+ else if (!lstrcmpi(xi.getName(itemval), _T("link"))) {
+ // We only use the first <link> tag for now and ignore the rest.
+ if (link == NULL) {
+ TCHAR *string = mir_tstrdup(xi.getText(itemval));
+ ClearText(string);
+ link = mir_tstrdup(string);
+ mir_free(string);
+ }
}
- if (!lstrcmpi(xi.getName(itemval), _T("pubDate"))) {
+ else if (!lstrcmpi(xi.getName(itemval), _T("pubDate"))) {
datetime = (TCHAR *)xi.getText(itemval);
- continue;
}
- if (!lstrcmpi(xi.getName(itemval), _T("dc:date"))) {
+ else if (!lstrcmpi(xi.getName(itemval), _T("dc:date"))) {
datetime = (TCHAR *)xi.getText(itemval);
- continue;
}
- if (!lstrcmpi(xi.getName(itemval), _T("description"))) {
+ else if (!lstrcmpi(xi.getName(itemval), _T("description"))) {
TCHAR *string = mir_tstrdup(xi.getText(itemval));
ClearText(string);
descr = mir_tstrdup(string);
mir_free(string);
- continue;
}
- if (!lstrcmpi(xi.getName(itemval), _T("author"))) {
+ else if (!lstrcmpi(xi.getName(itemval), _T("author"))) {
TCHAR *string = mir_tstrdup(xi.getText(itemval));
ClearText(string);
author = mir_tstrdup(string);
mir_free(string);
- continue;
}
- if (!lstrcmpi(xi.getName(itemval), _T("comments"))) {
+ else if (!lstrcmpi(xi.getName(itemval), _T("comments"))) {
TCHAR *string = mir_tstrdup(xi.getText(itemval));
ClearText(string);
comments = mir_tstrdup(string);
mir_free(string);
- continue;
}
- if (!lstrcmpi(xi.getName(itemval), _T("guid"))) {
+ else if (!lstrcmpi(xi.getName(itemval), _T("guid"))) {
TCHAR *string = mir_tstrdup(xi.getText(itemval));
ClearText(string);
guid = mir_tstrdup(string);
mir_free(string);
- continue;
}
- if (!lstrcmpi(xi.getName(itemval), _T("category"))) {
+ else if (!lstrcmpi(xi.getName(itemval), _T("category"))) {
TCHAR *string = mir_tstrdup(xi.getText(itemval));
ClearText(string);
category = mir_tstrdup(string);
mir_free(string);
- continue;
}
}
TCHAR *message;