Commit 44986146 44986146463782231f0e5152f353f184fd373d91 by Sergey Poznyakoff

Fixed behaviour of z. when the total number of messages is less than the number …

…of line per page of output.
1 parent 509a78a7
Showing 1 changed file with 6 additions and 1 deletions
......@@ -161,13 +161,18 @@ mail_z (int argc, char **argv)
int lastpage = total - pagelines + 1;
if (lastpage <= 0)
lastpage = 1;
if (cursor > (unsigned int)lastpage)
{
realcursor = cursor;
cursor = lastpage;
if (cursor + nlines > total)
nlines = total - cursor + 1;
for (i = 0; i < nlines; i++)
{
mail_from(0, NULL);
mail_from0 (cursor, 0);
cursor++;
}
cursor = realcursor;
......