rea() loops if more telegrams arrive while we wait for the player to
confirm deletion. If the first new one is a continuation of the last
old one, its header is suppressed. Don't do that.
Broken in commit
17223e8f, v4.3.29.
char mbox_buf[256]; /* Maximum path length */
struct telstr tgm;
FILE *telfp;
char mbox_buf[256]; /* Maximum path length */
struct telstr tgm;
FILE *telfp;
char buf[1024];
char *kind;
int n, res;
char buf[1024];
char *kind;
int n, res;
return RET_FAIL;
}
teles = 0;
return RET_FAIL;
}
teles = 0;
for (;;) {
res = tel_read_header(telfp, mbox, &tgm);
more:
for (;;) {
res = tel_read_header(telfp, mbox, &tgm);
more:
}
if (!teles && *kind == 'a')
pr("\nAnnouncements since %s", ctime(&then));
}
if (!teles && *kind == 'a')
pr("\nAnnouncements since %s", ctime(&then));
- if (!teles || !tgm.tel_cont) {
+ if (need_hdr || !tgm.tel_cont) {
pr("\n> ");
pr("%s ", telnames[tgm.tel_type]);
if ((tgm.tel_type == TEL_NORM) ||
pr("\n> ");
pr("%s ", telnames[tgm.tel_type]);
if ((tgm.tel_type == TEL_NORM) ||
pr(" dated %s", ctime(&tgm.tel_date));
}
teles++;
pr(" dated %s", ctime(&tgm.tel_date));
}
teles++;
res = tel_read_body(telfp, mbox, &tgm, print_sink, NULL);
if (res < 0)
break;
res = tel_read_body(telfp, mbox, &tgm, print_sink, NULL);
if (res < 0)
break;
res = tel_read_header(telfp, mbox, &tgm);
if (res != 0) {
pr("Wait a sec! A new %s has arrived...\n", kind);
res = tel_read_header(telfp, mbox, &tgm);
if (res != 0) {
pr("Wait a sec! A new %s has arrived...\n", kind);
goto more;
}
/* Here, we just re-open the file for "w" only,
goto more;
}
/* Here, we just re-open the file for "w" only,