Skip to content
Snippets Groups Projects
Commit 64b754a3 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
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
Branches
Tags
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #1475 passed
......@@ -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);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment