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
@@ -161,13 +161,18 @@ mail_z (int argc, char **argv) | |||
161 | int lastpage = total - pagelines + 1; | 161 | int lastpage = total - pagelines + 1; |
162 | if (lastpage <= 0) | 162 | if (lastpage <= 0) |
163 | lastpage = 1; | 163 | lastpage = 1; |
164 | |||
164 | if (cursor > (unsigned int)lastpage) | 165 | if (cursor > (unsigned int)lastpage) |
165 | { | 166 | { |
166 | realcursor = cursor; | 167 | realcursor = cursor; |
167 | cursor = lastpage; | 168 | cursor = lastpage; |
169 | |||
170 | if (cursor + nlines > total) | ||
171 | nlines = total - cursor + 1; | ||
172 | |||
168 | for (i = 0; i < nlines; i++) | 173 | for (i = 0; i < nlines; i++) |
169 | { | 174 | { |
170 | mail_from(0, NULL); | 175 | mail_from0 (cursor, 0); |
171 | cursor++; | 176 | cursor++; |
172 | } | 177 | } |
173 | cursor = realcursor; | 178 | cursor = realcursor; |