r1871 - in trunk/src/target/OM-2007/applications/openmoko-rssreader: . src

zecke at sita.openmoko.org zecke at sita.openmoko.org
Sun Apr 29 18:43:20 CEST 2007


Author: zecke
Date: 2007-04-29 18:43:19 +0200 (Sun, 29 Apr 2007)
New Revision: 1871

Modified:
   trunk/src/target/OM-2007/applications/openmoko-rssreader/ChangeLog
   trunk/src/target/OM-2007/applications/openmoko-rssreader/src/rfcdate.c
Log:
2007-04-29  Holger Hans Peter Freyther  <zecke at selfish.org>

        * src/rfcdate.c: Handle wrong dates
        (rss_rfc_date_set): If we can't parse set it to 26.01.1983
        (rss_rfc_date_compare): Check if the dates we pass to g_date_compae
are valid


Modified: trunk/src/target/OM-2007/applications/openmoko-rssreader/ChangeLog
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-rssreader/ChangeLog	2007-04-29 16:26:26 UTC (rev 1870)
+++ trunk/src/target/OM-2007/applications/openmoko-rssreader/ChangeLog	2007-04-29 16:43:19 UTC (rev 1871)
@@ -1,5 +1,12 @@
 2007-04-29  Holger Hans Peter Freyther  <zecke at selfish.org>
 
+        * src/rfcdate.c: Handle wrong dates
+        (rss_rfc_date_set): If we can't parse set it to 26.01.1983
+        (rss_rfc_date_compare): Check if the dates we pass to g_date_compae
+are valid
+
+2007-04-29  Holger Hans Peter Freyther  <zecke at selfish.org>
+
         * src/callbacks.c: Update documentation, move it around
         (feed_update_thread): Update documentation
         (cb_treeview_selection_changed): make the string i18nable

Modified: trunk/src/target/OM-2007/applications/openmoko-rssreader/src/rfcdate.c
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-rssreader/src/rfcdate.c	2007-04-29 16:26:26 UTC (rev 1870)
+++ trunk/src/target/OM-2007/applications/openmoko-rssreader/src/rfcdate.c	2007-04-29 16:43:19 UTC (rev 1871)
@@ -194,6 +194,7 @@
      * What should we do with these dates? round to the nearest legal date?
      */
     if ( !g_date_valid (self->date) ) {
+        g_date_set_dmy (self->date, 26, G_DATE_JANUARY, 1983 );
         g_print ("Setting RFC Date failed: '%s' %d %d %s %d  %ld\n",
                         rfc822date,
                         day,
@@ -207,10 +208,14 @@
 /*
  * Start by comparing the dates and only if they are equal compare
  * the times.
+ * For invalid dates we need a special treatment
  */
 gint
 rss_rfc_date_compare (RSSRFCDate *left, RSSRFCDate *right)
 {
+    g_assert ( g_date_valid (left->date) );
+    g_assert ( g_date_valid (right->date) );
+
     int date_result = g_date_compare( left->date, right->date );
     if (  date_result != 0 )
         return date_result;





More information about the commitlog mailing list