evolution-rss r373 - trunk/src
- From: lucilanga svn gnome org
- To: svn-commits-list gnome org
- Subject: evolution-rss r373 - trunk/src
- Date: Mon, 8 Sep 2008 06:12:17 +0000 (UTC)
Author: lucilanga
Date: Mon Sep 8 06:12:17 2008
New Revision: 373
URL: http://svn.gnome.org/viewvc/evolution-rss?rev=373&view=rev
Log:
2008-09-07 Lucian Langa <lucilanga gnome org>
* src/rss.c: include feed_is_new for
article checking too
* src/rss.c: feed_is_new()
fix for #550744 - prevent duplicate
feeds
* src/misc.c: get_server_from_uri()
sanitize input
* src/rss.c: org_gnome_cooly_format_rss
Modified:
trunk/src/misc.c
trunk/src/rss.c
Modified: trunk/src/misc.c
==============================================================================
--- trunk/src/misc.c (original)
+++ trunk/src/misc.c Mon Sep 8 06:12:17 2008
@@ -121,13 +121,20 @@
}
gchar *
-get_server_port(gchar *url)
+get_port_from_uri(gchar *uri)
{
- if (strstr(url, ":") == NULL)
+ g_return_val_if_fail( uri != NULL, NULL);
+
+ if (strstr(uri, "://") == NULL)
return NULL;
-
- gchar **str = g_strsplit(url, ":", 2);
- return str[2];
+ gchar **str = g_strsplit(uri, "://", 2);
+ gchar **str2 = g_strsplit(str[1], "/", 2);
+ gchar **str3 = g_strsplit(str2[0], ":", 2);
+ gchar *port = g_strdup(str3[1]);
+ g_strfreev(str);
+ g_strfreev(str2);
+ g_strfreev(str3);
+ return port;
}
gchar *
Modified: trunk/src/rss.c
==============================================================================
--- trunk/src/rss.c (original)
+++ trunk/src/rss.c Mon Sep 8 06:12:17 2008
@@ -4244,13 +4244,15 @@
memset(rfeed, 0, 512);
FILE *fr = fopen(file_name, "r");
int occ = 0;
- gchar *server = NULL;
- server = get_server_from_uri(needle);
- if (server == NULL)
- server = get_url_basename(needle);
- gchar *port = get_server_port(server);
- //in case URI part contains this
- gchar *tmpneedle = strextr(needle, port);
+ gchar *tmpneedle = NULL;
+ gchar *port = get_port_from_uri(needle);
+ if (port && atoi(port) == 80) {
+ gchar *tp = g_strconcat(":", port, NULL);
+ g_free(port);
+ tmpneedle = strextr(needle, tp);
+ g_free(tp);
+ } else
+ tmpneedle = g_strdup(needle);
if (fr)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]