[Top][All Lists]

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

Re: rfc822 date handling in imap4d/util.c

From: Sergey Poznyakoff
Subject: Re: rfc822 date handling in imap4d/util.c
Date: Fri, 15 Jun 2001 17:13:49 +0300


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:
      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?


reply via email to

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