[prev in list] [next in list] [prev in thread] [next in thread]
List: kmail-devel
Subject: Re: What do you guys think?
From: Andreas Gungl <Andreas.Gungl () osp-dd ! de>
Date: 2000-03-09 13:41:42
[Download RAW message or body]
That will do for two digit years only until 2070, right? ;-)
I'ld use the check part with the lower limit only.
Andreas
Don Sanders schrieb:
>
> http://bugs.kde.org/db/27/2798.html
>
> This patch looks reasonable, but I'm thinking we should lose the additional
> check part. Dates beyond 2037 shouldn't be a problem on 64bit systems.
>
> <quote>
> Package: kmail
> Version: 1.0.28
>
> This version of kmail included as part of the Linux Mandrake 6.1 distribution.
>
> I have recently received several mail messages where the date in the header
> has a 2 digit year code, eg
>
> Date: 03 Mar 00 10:16:23 UT
>
> When viewing the list of messages in the Header pane, kmail displays
> the message as having been sent in a year between 1970 and 1976, instead of
> the year 2000.
>
> This problem is solved by changing a line of code in the ParseRfc822Date()
> function around line 314 in the file kdesupport/mimelib/dw_date.cpp
> The original code (shown with some surrounding lines) is:
> if (n != -1) {
> year = (n < 1900) ? n+1900 : n;
> }
> else {
> isValid = 0;
> }
> /*
> * Hour -- two digits
>
> I changed this to the following
> if (n != -1) {
> /* Tony: Fixed year 2000 problem */
> if (n < 70)
> n += 2000; /* When less than 70 assume after year 2000 */
> else if (n <= 99)
> n += 1900; /* When >69 and <100 assume 1970 to 1999 */
>
> /* Additional check to limit valid range to 1970 to 2037 */
> if ((n >= 1970) && (n < 2038))
> year = n;
> else
> isValid = 0;
> }
> else {
> isValid = 0;
> }
> /*
> * Hour -- two digits
>
> I am happy for you to use this fix for the next issue of kde and kmail.
>
> I hope this is useful.
>
> Tony
> <unquote>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic