diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2002-11-07 10:23:10 +0000 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2002-11-07 10:23:10 +0000 |
commit | 44986146463782231f0e5152f353f184fd373d91 (patch) | |
tree | 4d151d32a69fee653412fa5e68816bd0c1b1449c | |
parent | 509a78a7b31ac62800624157176cc9b7d2834910 (diff) | |
download | mailutils-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.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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; } } |