References and wrapped headers
Russ Allbery
rra at stanford.edu
Mon Dec 23 19:26:46 UTC 2002
Jeffrey M Vinocur <jeff at litech.org> writes:
> Did anybody change the overview generation and/or wrapped-header-parsing
> code recently? Specifically, as might relate to makehistory.
> After the previously-mentioned overview rebuild yesterday, I'm seeing
> articles where only the first two entries from References are listed in
> overview. Looking at the original articles, that header wrapped onto
> half-a-dozen lines, and only the two entries that fit on the first line
> were included in overview.
Hm. This code in makehistory looks wrong to me:
if ((fp->Header = HeaderFindMem(art->data, art->len, fp->Headername, fp->HeadernameLength)) != (char *)NULL) {
fp->HasHeader = TRUE;
for (p = fp->Header, p1 = (char *)NULL; p < art->data + art->len; p++) {
if (p1 != (char *)NULL && (*p1 == '\r' || *p1 == '\n') &&
!ISWHITE(*p))
break;
p1 = p;
}
ISWHITE just tests whether the character is ' ' or '\t'. This looks like
it fails badly when fed an article in wire format with wrapped headers,
since when p is pointing to '\n', p1 is pointing to '\r', and p1 is
non-NULL, *p1 equals '\r', and *p isn't ' ' or '\t'.
Am I missing something?
If not, this has been there since April of 2001. It looks like the goal
was to allow \r by itself as a line terminator. Hm. Aren't we guaranteed
that all articles returned by the storage manager are in wire format? If
so, there shouldn't be any need to consider line endings other than \r\n,
right?
--
Russ Allbery (rra at stanford.edu) <http://www.eyrie.org/~eagle/>
Please send questions to the list rather than mailing me directly.
<http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
More information about the inn-workers
mailing list