summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mail/z.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/mail/z.c b/mail/z.c
index c9bc5bfcc..5f06409f9 100644
--- a/mail/z.c
+++ b/mail/z.c
@@ -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;

Return to:

Send suggestions and report system problems to the System administrator.