Re: Bug in RFC822.py (correction)

Steve Kirsch (stk@infoseek.com)
29 Jul 1994 01:55:27 GMT

Whoops! I spoke too soon! Moving the list = [] doesn't work because
if the name you are looking for isn't there, then list is undefined when the
function returns.

The way I fixed it here (and tested it this time!) is to add "and not hit" at
the end of the first if statement in getfirstmatching header.

Hence, the code now reads:
if string.lower(line[:n]) == name and not hit:

That way, you truly get only the first matching header and any continuation lines,
avoiding the case where the header is repeated immediately as in:

Reply-To: stk
Reply-To: stk

---
Steven T. Kirsch 
InfoSeek Corporation
2620 Augustine Dr #250
Santa Clara, CA 95054
 
stk@infoseek.com  (408) 982-4463  FAX: (408) 986-1889