email_pager(): improved status bar and fixed EOF bug (last line shown twice)

This commit is contained in:
Bobbi Webber-Manners 2020-07-29 18:21:10 -04:00
parent d6841c517c
commit be340f0c1c

View File

@ -864,8 +864,10 @@ restart:
readp = linebuf;
if (!writep)
writep = linebuf;
if (get_line(fp, 0, writep, &pos) == -1)
if (get_line(fp, 0, writep, &pos) == -1) {
eof = 1;
goto endscreen;
}
++linecount;
if ((mime >= 1) && (!strncmp(writep, "--", 2))) {
if (attachfp)
@ -972,8 +974,9 @@ restart:
readp = writep = NULL;
}
}
endscreen:
if ((*cursorrow == 22) || eof) {
printf("\n%c[%05lu] %s | B)ack | T)op | H)drs | M)IME | Q)uit%c",
printf("\n%c[%07lu] %s | B)ack | T)op | H)drs | M)IME | Q)uit%c",
INVERSE,
pos,
(eof ? " ** END ** " : "SPACE continue reading"),