[Commits] [SCM] claws branch, master, updated. 3.14.1-215-g9327286

ticho at claws-mail.org ticho at claws-mail.org
Sat Mar 4 00:14:10 CET 2017


The branch, master has been updated
       via  9327286516f1f545795b741921ec8c8939afe595 (commit)
      from  f65a20ac306d2ddfbeb5397e201288f0c22ac711 (commit)

Summary of changes:
 src/procheader.c |   15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)


- Log -----------------------------------------------------------------
commit 9327286516f1f545795b741921ec8c8939afe595
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Sat Mar 4 00:12:29 2017 +0100

    Add support for date-only variant of ISO8601 timestamp format.
    
    Fixes bug #3777 - Weird news dates for some RSS feeds

diff --git a/src/procheader.c b/src/procheader.c
index 88d26db..efa3a7f 100644
--- a/src/procheader.c
+++ b/src/procheader.c
@@ -947,8 +947,8 @@ static gint procheader_scan_date_string(const gchar *str,
 
 	*zone = '\0';
 
-	/* RFC3339 subset */
-	/* This particular "subset" is invalid, RFC requires the time offset */
+	/* RFC3339 subset, no fraction of second, and no timezone offset */
+	/* This particular "subset" is invalid, RFC requires the offset */
 	result = sscanf(str, "%4d-%2d-%2d %2d:%2d:%2d",
 			year, &month_n, day, hh, mm, ss);
 	if (result == 6) {
@@ -958,6 +958,17 @@ static gint procheader_scan_date_string(const gchar *str,
 		}
 	}
 
+	/* ISO8601 format with just date (YYYY-MM-DD) */
+	result = sscanf(str, "%4d-%2d-%2d",
+			year, &month_n, day);
+	if (result == 3) {
+		*hh = *mm = *ss = 0;
+		if (1 <= month_n && month_n <= 12) {
+			strncpy2(month, monthstr+((month_n-1)*3), 4);
+			return 0;
+		}
+	}
+
 	return -1;
 }
 

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list