[Users] [PATCH v2] Handle additional Date header format

Alexander Lyons Harkness me at bearbin.net
Sun Aug 25 23:07:48 CEST 2019


Dates of this format: `Wed Jul  3 22:36:42 2019` were observed in
my inbox but were not handled by the existing code.

Signed-off-by: Alexander Lyons Harkness <me at bearbin.net>
---
I had a look at some of my other inboxes and found another unhandled
date format of similar form, so I'm including it here as v2.

 src/procheader.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/procheader.c b/src/procheader.c
index d384db00e..f5755b6a3 100644
--- a/src/procheader.c
+++ b/src/procheader.c
@@ -938,6 +938,10 @@ static gint procheader_scan_date_string(const gchar *str,
 			weekday, day, month, year, hh, mm, ss, zone);
 	if (result == 8) return 0;
 
+	result = sscanf(str, "%3s %3s %d %2d:%2d:%2d %d %6s",
+			weekday, month, day, hh, mm, ss, year, zone);
+	if (result == 8) return 0;
+
 	result = sscanf(str, "%d %9s %d %2d:%2d:%2d %6s",
 			day, month, year, hh, mm, ss, zone);
 	if (result == 7) return 0;
@@ -947,6 +951,10 @@ static gint procheader_scan_date_string(const gchar *str,
 			weekday, day, month, year, hh, mm, ss);
 	if (result == 7) return 0;
 
+	result = sscanf(str, "%3s %3s %d %2d:%2d:%2d %d",
+			weekday, month, day, hh, mm, ss, year);
+	if (result == 7) return 0;
+
 	result = sscanf(str, "%d %9s %d %2d:%2d:%2d",
 			day, month, year, hh, mm, ss);
 	if (result == 6) return 0;
-- 
2.23.0.rc1



More information about the Users mailing list