[net.bugs.4bsd] ucbmail/fmt bug

dmmartindale (01/16/83)

The fmt program supplied with ucbmail sometimes mangles the headers
of mail messages included within the text it is formatting, even though
it tries to leave them untouched.  The problem is in the ispref() routine-
it doesn't even come close to doing what it's supposed to do.
While you're fixing it up, it's worthwhile making it understand that Status:
lines are also part of the header, and that the header is now sometimes longer.
(It just checks the N lines following a From line to see if they look like
header lines - it will have to be rewritten for use with sendmail's longer
and more diverse headers, but this helps for now).
The changes needed are:

22c22
< char	*headnames[] = {"To", "Subject", "Cc", 0};
---
> char	*headnames[] = {"To", "Subject", "Cc", "Status", 0};
170c170
< 	if (lineno - mark < 3 && lineno - mark > 0)
---
> 	if (lineno - mark <= 4 && lineno - mark > 0)
390,392c390,393
< 	while (*s1++ == *s2)
< 		;
< 	return(*s1 == '\0');
---
> 	while (*s1 != '\0')
> 		if (*s1++ != *s2++)
> 			return(0);
> 	return(1);



Dave Martindale