aboutsummaryrefslogtreecommitdiffstats
path: root/driver.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1997-01-30 17:29:36 +0000
committerEric S. Raymond <esr@thyrsus.com>1997-01-30 17:29:36 +0000
commit65179f921d37756ed89e1ef7965e13bd5f319650 (patch)
treefdabc324b67d060eab0509040cbc1a7b998658a5 /driver.c
parent6a529e4eac97ac7255229fbadcac721b5ba6925b (diff)
downloadfetchmail-65179f921d37756ed89e1ef7965e13bd5f319650.tar.gz
fetchmail-65179f921d37756ed89e1ef7965e13bd5f319650.tar.bz2
fetchmail-65179f921d37756ed89e1ef7965e13bd5f319650.zip
Add stripcr option.
svn path=/trunk/; revision=842
Diffstat (limited to 'driver.c')
-rw-r--r--driver.c44
1 files changed, 25 insertions, 19 deletions
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);