From 04b4414e714f3d1e39a9ed2728c2b01d9a659739 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Mon, 8 Sep 2008 14:42:19 +0000 Subject: [PATCH] Monotone-Parent: e918f87785e229a7bb693f66c14d9437220b0140 Monotone-Revision: ee6476408bb7a66b076d467660edc1f7030ecc34 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2008-09-08T14:42:19 Monotone-Branch: ca.inverse.sogo --- SOPE/sope-patchset-r1626.diff | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/SOPE/sope-patchset-r1626.diff b/SOPE/sope-patchset-r1626.diff index 9428c12ab..145be2290 100644 --- a/SOPE/sope-patchset-r1626.diff +++ b/SOPE/sope-patchset-r1626.diff @@ -2058,6 +2058,15 @@ Index: sope-mime/NGMime/NGMimeRFC822DateHeaderFieldParser.m } /* +@@ -111,7 +68,7 @@ + TODO: use an own parser for that. + */ + +-static int parseMonthOfYear(unsigned char *s, unsigned int len) { ++static int parseMonthOfYear(char *s, unsigned int len) { + /* + This one is *extremely* forgiving, it only checks what is + necessary for the set below. This should work for both, English @@ -147,162 +104,110 @@ } } @@ -2282,7 +2291,7 @@ Index: sope-mime/NGMime/NGMimeRFC822DateHeaderFieldParser.m NSCalendarDate *date = nil; - unsigned char buf[256]; - unsigned char *bytes = buf, *pe; -+ unsigned char *bytes, *pe; ++ char *bytes, *pe; unsigned length = 0; NSTimeZone *tz = nil; char dayOfMonth, monthOfYear, hour, minute, second; @@ -2315,16 +2324,17 @@ Index: sope-mime/NGMime/NGMimeRFC822DateHeaderFieldParser.m } // TODO: should be a category on NSCalendarDate -@@ -435,7 +340,7 @@ +@@ -435,7 +340,8 @@ for (pe = bytes; isalnum(*pe) || *pe == '-' || *pe == '+'; pe++) ; *pe = '\0'; - if ((tz = parseTimeZone(bytes, (pe - bytes))) == nil) { -+ if ((tz = parseTimeZone((const char *) bytes, (pe - bytes))) == nil) { ++ if (pe == bytes ++ || (tz = parseTimeZone((const char *) bytes, (pe - bytes))) == nil) { [self logWithFormat: @"WARNING: failed to parse RFC822 timezone: '%s' (value='%@')", bytes, _data]; -@@ -444,9 +349,9 @@ +@@ -444,9 +350,9 @@ /* construct and return */ finished: @@ -2530,7 +2540,13 @@ Index: sope-mime/NGMime/ChangeLog =================================================================== --- sope-mime/NGMime/ChangeLog (révision 1626) +++ sope-mime/NGMime/ChangeLog (copie de travail) -@@ -1,3 +1,19 @@ +@@ -1,3 +1,25 @@ ++2008-09-08 Wolfgang Sourdeau ++ ++ * NGMimeRFC822DateHeaderFieldParser.m ([NGMimeRFC ++ -parseValue:ofHeaderField:]): don't parse timezone with a length ++ of 0. ++ +2008-09-01 Wolfgang Sourdeau + + * NGMimeRFC822DateHeaderFieldParser.m ([NGMimeRFC