summaryrefslogtreecommitdiffstats
path: root/sca-cpp/trunk/modules/atom/atom.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'sca-cpp/trunk/modules/atom/atom.hpp')
-rw-r--r--sca-cpp/trunk/modules/atom/atom.hpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/sca-cpp/trunk/modules/atom/atom.hpp b/sca-cpp/trunk/modules/atom/atom.hpp
index bb39e7c262..253be9bdd6 100644
--- a/sca-cpp/trunk/modules/atom/atom.hpp
+++ b/sca-cpp/trunk/modules/atom/atom.hpp
@@ -57,12 +57,12 @@ const list<value> entriesElementsToValues(const list<value>& e) {
}
/**
- * Return true if a list of strings contains an RSS feed.
+ * Return true if a list of strings contains an ATOM feed.
*/
const bool isATOMFeed(const list<string>& ls) {
if (!isXML(ls))
return false;
- return contains(car(ls), "<feed");
+ return contains(car(ls), "<feed") && contains(car(ls), "=\"http://www.w3.org/2005/Atom\"");
}
/**
@@ -179,7 +179,9 @@ const failable<list<string> > writeATOMFeed(const list<value>& l) {
* Convert an ATOM entry containing a value to an ATOM entry containing an item element.
*/
const list<value> entryValuesToElements(const list<value> val) {
- return cons(car(val), cons(cadr(val), valuesToElements(mklist<value>(cons<value>("item", (list<value>)caddr(val))))));
+ if (isList(caddr(val)))
+ return cons(car(val), cons(cadr(val), valuesToElements(mklist<value>(cons<value>("item", (list<value>)caddr(val))))));
+ return cons(car(val), cons(cadr(val), valuesToElements(mklist<value>(mklist<value>("item", caddr(val))))));
}
/**