Subject: Re: bin/3286: sendmail doesn't escape 'From'
To: None <mike.long@analog.com>
From: Andrew Wheadon <andrew@wipux2.wifo.uni-mannheim.de>
List: netbsd-bugs
Date: 03/05/1997 17:12:08
> You missed my point, which should have been apparent given the rest of
> my previous message. My proposal was simply to make mail.local escape
> all lines that match the regexp "^From ", regardless of the contents
> of the previous line. I believe the increased robustness is worth a
> few extra '>' characters.
I fully agree with this opinion.
Now is there a nicer way than this of implementing it ?
(Untested because I don't think it looks pretty, there must be
a cleaner way.)
Cheerio
Andrew
--- ../mail.local/mail.local.c Sat Oct 14 02:05:27 1995
+++ mail.local.c Wed Mar 5 17:06:38 1997
@@ -125,7 +125,7 @@
{
FILE *fp;
time_t tval;
- int fd, eline;
+ int fd;
char *tn, line[2048];
tn = strdup(_PATH_LOCTMP);
@@ -138,14 +138,9 @@
(void)fprintf(fp, "From %s %s", from, ctime(&tval));
line[0] = '\0';
- for (eline = 1; fgets(line, sizeof(line), stdin);) {
- if (line[0] == '\n')
- eline = 1;
- else {
- if (eline && line[0] == 'F' && !bcmp(line, "From ", 5))
- (void)putc('>', fp);
- eline = 0;
- }
+ for (;fgets(line, sizeof(line), stdin);) {
+ if (line[0] == 'F' && !bcmp(line, "From ", 5))
+ (void)putc('>', fp);
(void)fprintf(fp, "%s", line);
if (ferror(fp))
break;
--
The cost of living hasn't affected its popularity. (Mark Twain)
current release=doc host=netbsd.wifo.uni-mannheim.de \ "NetBSD-current mirror"
hostbase=/mit/ftp/pub/NetBSD base=/usr prefix=/usr backup delete use-rel-suffix