From 65179f921d37756ed89e1ef7965e13bd5f319650 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Thu, 30 Jan 1997 17:29:36 +0000 Subject: Add stripcr option. svn path=/trunk/; revision=842 --- driver.c | 44 +++++++++++++++++++++++++------------------- 1 file changed, 25 insertions(+), 19 deletions(-) (limited to 'driver.c') diff --git a/driver.c b/driver.c index d11d8c2a..aad43332 100644 --- a/driver.c +++ b/driver.c @@ -765,19 +765,22 @@ char *realname; /* real name of host */ } /* write all the headers */ - if (sinkfp) + if (ctl->stripcr) { - if (ctl->mda) - { - char *sp, *tp; + char *sp, *tp; - for (sp = tp = headers; *sp; sp++) - if (*sp != '\r') - *tp++ = *sp; - *tp = '\0'; + for (sp = tp = headers; *sp; sp++) + if (*sp != '\r') + *tp++ = *sp; + *tp = '\0'; + } + + /* write all the headers */ + if (sinkfp) + { + if (ctl->mda) n = fwrite(headers, 1, strlen(headers), sinkfp); - } else n = SockWrite(headers, 1, strlen(headers), sinkfp); @@ -842,18 +845,20 @@ char *realname; /* real name of host */ strcat(errmsg, "\n"); /* ship out the error line */ + if (ctl->stripcr) + { + char *sp, *tp; + + for (sp = tp = errmsg; *sp; sp++) + if (*sp != '\r') + *tp++ = *sp; + *tp = '\0'; + } + if (sinkfp) { if (ctl->mda) - { - char *sp, *tp; - - for (sp = tp = errmsg; *sp; sp++) - if (*sp != '\r') - *tp++ = *sp; - *tp = '\0'; fwrite(errmsg, 1, strlen(errmsg), sinkfp); - } else SockWrite(errmsg, 1, strlen(errmsg), sinkfp); } @@ -909,7 +914,7 @@ char *realname; /* real name of host */ else SockWrite(buf, 1, 1, sinkfp); - if (ctl->mda) + if (ctl->stripcr) { char *sp, *tp; @@ -917,9 +922,10 @@ char *realname; /* real name of host */ if (*sp != '\r') *tp++ = *sp; *tp = '\0'; + } + if (ctl->mda) n = fwrite(buf, 1, strlen(buf), sinkfp); - } else if (sinkfp) n = SockWrite(buf, 1, strlen(buf), sinkfp); -- cgit v1.2.3