bug-mailutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: rfc822 date handling in imap4d/util.c


From: Alain Magloire
Subject: Re: rfc822 date handling in imap4d/util.c
Date: Fri, 15 Jun 2001 10:25:40 -0400 (EDT)

> 
> Bonjour,
> 
> Some thoughts about usage of imap_parse_date_time() in
> util_parse_internal_date0(): the latter is meant to parse date
> (not date_time) string, which according to rfc 2060 is
> 
> date            ::= date_text / <"> date_text <">
> 
> date_text       ::= date_day "-" date_month "-" date_year
> 
> i.e.: no time/timezone string. So, to correctly parse this,
> imap_parse_date_time() should be:
> 
>   switch (sscanf (*p,
>             "%2d-%3s-%4d %2d:%2d:%2d %5s%n",
>             &day, month, &year, &hour, &min, &sec, zone, &scanned))
>     {
>     case 3:
>     case 7:
>       break;
>     default:
>       return -1;
>     }
> 
> instead of simply doing
> 
>    if ((sscanf (*p,
>             "%2d-%3s-%4d %2d:%2d:%2d %5s%n",
>             &day, month, &year, &hour, &min, &sec, zone, &scanned)) != 7)
> 
> Any objections?

Niet.

--
alain, "it's to hot here, runaway, runawy .."




reply via email to

[Prev in Thread] Current Thread [Next in Thread]