diff options
author | Eric S. Raymond <esr@thyrsus.com> | 1997-01-30 17:29:36 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 1997-01-30 17:29:36 +0000 |
commit | 65179f921d37756ed89e1ef7965e13bd5f319650 (patch) | |
tree | fdabc324b67d060eab0509040cbc1a7b998658a5 /driver.c | |
parent | 6a529e4eac97ac7255229fbadcac721b5ba6925b (diff) | |
download | fetchmail-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.c | 44 |
1 files changed, 25 insertions, 19 deletions
@@ -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); |