Spec. for check_field()?
Ralph Corderoy <[email protected]>
| Newsgroups | gmane.network.sn |
|---|---|
| Message-ID | <[email protected]> |
Hi,
snstore is giving me `append: bad header' errors. On looking at
check_field() in field.c I see
int check_field (char *field, int len)
{
int i;
for (i = 0; i < len; i++)
{
if (field[i] >= 'a' && field[i] <= 'z')
continue;
if (field[i] >= 'A' && field[i] <= 'Z')
continue;
if (field[i] >= '0' && field[i] <= '9')
continue;
if ('-' == field[i])
continue;
if (':' == field[i])
return (i);
if (' ' == field[i] || '\t' == field[i])
break;
return (0);
}
do
i++;
while (field[i] == ' ' || field[i] == '\t');
if (':' != field[i])
return (0);
return (i);
}
That seems to be matching /^[a-zA-Z0-9-]*[ \t]*:/. What's the RFC or
other spec. for this routine? It doesn't allow `=' for example, and
would pass ` :' AFAICS.
Shouldn't it be /^[\x21-\x39\x3b-\x7e]+:/, i.e. one or more of any
printable character, except a colon, followed by a colon. That's from a
quick look at section 3.2 in http://www.faqs.org/rfcs/rfc822.html.
Cheers,
Ralph.
PS. Anyone out there?