summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2002-11-07 10:23:10 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2002-11-07 10:23:10 +0000
commit44986146463782231f0e5152f353f184fd373d91 (patch)
tree4d151d32a69fee653412fa5e68816bd0c1b1449c
parent509a78a7b31ac62800624157176cc9b7d2834910 (diff)
downloadmailutils-44986146463782231f0e5152f353f184fd373d91.tar.gz
mailutils-44986146463782231f0e5152f353f184fd373d91.tar.bz2
Fixed behaviour of z. when the total number of messages is less than the number of line per page of output.
-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
@@ -158,19 +158,24 @@ mail_z (int argc, char **argv)
are last but we want to display a screenful with the
real cursor set by summary() to the new message. */
/* Find the start of the last screen page. */
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 1;
}
}

Return to:

Send suggestions and report system problems to the System administrator.