Commit 64b754a3 authored by Rob Swindell's avatar Rob Swindell 💬
Browse files

Fix issue display AREA keywords at beginning of body text

or any lines that were only terminated with carriage-return (\r)
since these are treated rather-oddly by the FTN software as a
line-ending and line-feeds are to be ignored. So transfer \r to \n
on output and ignore the \n's in the body text.
parent ec12ae2e
Pipeline #1475 passed with stage
in 18 minutes and 17 seconds
......@@ -73,7 +73,7 @@ const char* fmsgattr_str(uint16_t attr)
int pktdump(FILE* fp, const char* fname, FILE* good, FILE* bad)
{
int ch,lastch=0;
int ch,lastch;
char buf[128];
char to[FIDO_NAME_LEN];
char from[FIDO_NAME_LEN];
......@@ -240,6 +240,7 @@ int pktdump(FILE* fp, const char* fname, FILE* good, FILE* bad)
fprintf(bodyfp,"\n-start of message text-\n");
size_t count = 0;
lastch = 0;
while((ch=fgetc(fp))!=EOF && ch!=0) {
count++;
if((count == 1 || lastch == '\r') && ch == 1) {
......@@ -251,9 +252,8 @@ int pktdump(FILE* fp, const char* fname, FILE* good, FILE* bad)
break;
continue;
}
if(lastch=='\r' && ch!='\n')
fputc('\n',bodyfp);
fputc(lastch=ch,bodyfp);
fputc(ch == '\r' ? '\n' : ch, bodyfp);
lastch = ch;
if(good != NULL)
fputc(ch, good);
}
......
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