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
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #1475 passed
...@@ -73,7 +73,7 @@ const char* fmsgattr_str(uint16_t attr) ...@@ -73,7 +73,7 @@ const char* fmsgattr_str(uint16_t attr)
int pktdump(FILE* fp, const char* fname, FILE* good, FILE* bad) int pktdump(FILE* fp, const char* fname, FILE* good, FILE* bad)
{ {
int ch,lastch=0; int ch,lastch;
char buf[128]; char buf[128];
char to[FIDO_NAME_LEN]; char to[FIDO_NAME_LEN];
char from[FIDO_NAME_LEN]; char from[FIDO_NAME_LEN];
...@@ -240,6 +240,7 @@ int pktdump(FILE* fp, const char* fname, FILE* good, FILE* bad) ...@@ -240,6 +240,7 @@ int pktdump(FILE* fp, const char* fname, FILE* good, FILE* bad)
fprintf(bodyfp,"\n-start of message text-\n"); fprintf(bodyfp,"\n-start of message text-\n");
size_t count = 0; size_t count = 0;
lastch = 0;
while((ch=fgetc(fp))!=EOF && ch!=0) { while((ch=fgetc(fp))!=EOF && ch!=0) {
count++; count++;
if((count == 1 || lastch == '\r') && ch == 1) { if((count == 1 || lastch == '\r') && ch == 1) {
...@@ -251,9 +252,8 @@ int pktdump(FILE* fp, const char* fname, FILE* good, FILE* bad) ...@@ -251,9 +252,8 @@ int pktdump(FILE* fp, const char* fname, FILE* good, FILE* bad)
break; break;
continue; continue;
} }
if(lastch=='\r' && ch!='\n') fputc(ch == '\r' ? '\n' : ch, bodyfp);
fputc('\n',bodyfp); lastch = ch;
fputc(lastch=ch,bodyfp);
if(good != NULL) if(good != NULL)
fputc(ch, good); fputc(ch, good);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment