aboutsummaryrefslogtreecommitdiff
path: root/libraries/libmrss/atom-link.diff
blob: fa4e68628b14f756a5b48cc32131b362799d113e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Description: Fixes wrong <link> parsed is Atom feeds
Debian BTS: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=503225

diff -Naur libmrss-0.19.2/src/mrss_parser.c libmrss-0.19.2.atom/src/mrss_parser.c
--- libmrss-0.19.2/src/mrss_parser.c	2008-08-21 15:59:22.000000000 -0600
+++ libmrss-0.19.2.atom/src/mrss_parser.c	2008-12-07 11:30:43.000000000 -0700
@@ -367,7 +367,16 @@
 	  /* link href -> link */
 	  else if (!item->link && !strcmp (cur->value, "link")
 		   && (c = nxmle_find_attribute (cur, "href", NULL)))
-	    item->link = c;
+	    {
+		char *t;
+		
+		/* alternate link is either rel="alternate" or a link tag
+		 * without a rel attribute
+		 */
+		t = nxmle_find_attribute (cur, "rel", NULL);
+		if ((t && !strcmp(t, "alternate")) || !t)
+		  item->link = c;
+	    }
 
 	  /* content -> description */
 	  else if (!item->description && !strcmp (cur->value, "content"))