Commit ed6cb816 authored by rswindell's avatar rswindell
Browse files

Apply the "Strip Line Feed" option logic to exported NetMail messages too

(when set to Yes).
parent 2328b204
......@@ -1641,7 +1641,7 @@ int main(int argc, char **argv)
"\n"
"`Strip Line Feeds from Outgoing Messages` when set to `Yes` instructs\n"
" SBBSecho to remove any line-feed (ASCII 10) characters from the body\n"
" text of messages being exported to FidoNet EchoMail.\n"
" text of exported EchoMail and NetMail messages.\n"
" This setting defaults to `No`.\n"
"\n"
"`Automatically Add New Subs to Area File`, when set to `Yes`, enables\n"
......
......@@ -867,7 +867,7 @@ int write_flofile(const char *infile, fidoaddr_t dest, bool bundle, bool use_out
return 0;
}
/* Writes text buffer to file, expanding sole LFs to CRLFs */
/* Writes text buffer to file, expanding sole LFs to CRLFs or stripping LFs */
size_t fwrite_crlf(const char* buf, size_t len, FILE* fp)
{
char ch,last_ch=0;
......@@ -876,10 +876,14 @@ size_t fwrite_crlf(const char* buf, size_t len, FILE* fp)
for(i=0;i<len;i++) {
ch=*buf++;
if(ch=='\n' && last_ch!='\r') {
if(fputc('\r', fp) == EOF)
break;
wr++;
if(ch=='\n') {
if(last_ch!='\r') {
if(fputc('\r', fp) == EOF)
break;
wr++;
}
if(cfg.strip_lf)
continue;
}
if(fputc(ch,fp)==EOF)
break;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment