On Fri, Oct 21, 2011 at 9:46 AM, John Jetmore <j...@pobox.com> wrote:
> On Fri, Oct 21, 2011 at 3:31 AM, Peter Samuelson <pet...@p12n.org> wrote:
>>
>> Package: swaks
>> Version: 20100211.0-4
>> Tags: patch
>>
>> The timezone field of RFC 822 date format is [+-]HHMM, whereas swaks
>> calculates it as hundredths-of-an-hour.  So it is wrong any time the MM
>> field is nonzero.  For example:
>>
>> Timezone             RFC822   swaks
>> -----------------------------------
>> Canada/Newfoundland   -0230   -0250
>> Asia/Tehran           +0330   +0350
>> Asia/Kathmandu        +0545   +0575
>> Australia/Eucla       +0845   +0875
>>
>> Peter
>>
>>
>> --- swaks
>> +++ swaks
>> @@ -1946,7 +1946,8 @@
>>     @l = gmtime($et);
>>   } else {
>>     my @g = gmtime($et);
>> -    $o = (timelocal(@l) - timelocal(@g))/36;
>> +    $o = (timelocal(@l) - timelocal(@g))/60;
>> +    $o = int($o / 60)*100 + ($o%60)*($o > 0 ? 1 : -1);
>>   }
>>   $G::date_string = sprintf("%s, %02d %s %d %02d:%02d:%02d %+05d",
>>                  (qw(Sun Mon Tue Wed Thu Fri Sat))[$l[6]],
>>
>
> Now that's just embarrassing...  Thanks for catching this issue and
> providing the patch.  I just checked it into my repo.  I have to say
> that's a nice patch - I was sure I could make it simpler, but there
> are a lot of fiddly edge cases, I couldn't get anything simpler.  Nice
> job =).

This is patched in just-released version 20111230.0,
http://www.jetmore.org/john/blog/2011/12/swaks-release-20111230-0-available/.

Thanks again for the report and the tidy patch.

--John



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to