From 44986146463782231f0e5152f353f184fd373d91 Mon Sep 17 00:00:00 2001 From: Sergey Poznyakoff Date: Thu, 7 Nov 2002 10:23:10 +0000 Subject: Fixed behaviour of z. when the total number of messages is less than the number of line per page of output. --- mail/z.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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; -- cgit v1.2.1