summaryrefslogtreecommitdiffabout
authorSergey Poznyakoff <gray@gnu.org.ua>2002-11-07 10:23:10 (GMT)
committer Sergey Poznyakoff <gray@gnu.org.ua>2002-11-07 10:23:10 (GMT)
commit44986146463782231f0e5152f353f184fd373d91 (patch) (side-by-side diff)
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.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--mail/z.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/mail/z.c b/mail/z.c
index c9bc5bf..5f06409 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.