Commit 931b3549 931b354984a74776ad68145d03c4d3ca6e73fd82 by Sergey Poznyakoff

Do not count deleted messages into the total number of lines output.

1 parent 4757badf
Showing 1 changed file with 4 additions and 3 deletions
...@@ -179,12 +179,13 @@ mail_z (int argc, char **argv) ...@@ -179,12 +179,13 @@ mail_z (int argc, char **argv)
179 179
180 realcursor = cursor; 180 realcursor = cursor;
181 181
182 for (i = 0; i < nlines; i++) 182 for (i = 0; i < nlines && cursor <= total; )
183 { 183 {
184 mail_from(0, NULL); 184 if (mail_from(0, NULL) == 0)
185 i++;
185 cursor++; 186 cursor++;
186 } 187 }
187 188
188 cursor = realcursor; 189 cursor = realcursor;
189 190
190 return 1; 191 return 1;
......