X-Git-Url: http://vcs.maemo.org/git/?a=blobdiff_plain;f=src%2Fprss.c;h=5a57f6b217700a0f080d724737cc27f5be2af7d2;hb=2913a7121634c99cc685e5bdfdddfef519ce0830;hp=5c7d191110edbe0ce66630315b84a4ed32395e1b;hpb=4766f33456020488be26f28427e973552c8d3a1e;p=monky diff --git a/src/prss.c b/src/prss.c index 5c7d191..5a57f6b 100644 --- a/src/prss.c +++ b/src/prss.c @@ -78,12 +78,13 @@ static inline void read_item(PRSS_Item *res, xmlNodePtr data) res->title = res->link = res->description = NULL; for (; data; data = data->next) { + xmlNodePtr child; const char *name; if (data->type != XML_ELEMENT_NODE) { continue; } - xmlNodePtr child = data->children; + child = data->children; if (!child) { continue; @@ -107,12 +108,13 @@ static inline void read_item(PRSS_Item *res, xmlNodePtr data) } static inline void read_element(PRSS *res, xmlNodePtr n) { + xmlNodePtr child; const char *name; if (n->type != XML_ELEMENT_NODE) { return; } - xmlNodePtr child = n->children; + child = n->children; if (!child) { return; @@ -151,6 +153,8 @@ static inline void read_element(PRSS *res, xmlNodePtr n) static inline int parse_rss_2_0(PRSS *res, xmlNodePtr root) { xmlNodePtr channel = root->children; + xmlNodePtr n; + int items = 0; while (channel && (channel->type != XML_ELEMENT_NODE || strcmp((const char *) channel->name, "channel"))) { @@ -160,9 +164,6 @@ static inline int parse_rss_2_0(PRSS *res, xmlNodePtr root) return 0; } - int items = 0; - xmlNodePtr n; - for (n = channel->children; n; n = n->next) { if (n->type == XML_ELEMENT_NODE && !strcmp((const char *) n->name, "item")) {