|
|
@@ -255,13 +255,12 @@ scrollup(void)
|
|
|
struct line *bottom_old = bottom;
|
|
|
|
|
|
/* account for last line */
|
|
|
- if(bottom != NULL && TAILQ_PREV(bottom, tailhead, entries) == NULL)
|
|
|
+ if (bottom != NULL && TAILQ_PREV(bottom, tailhead, entries) == NULL)
|
|
|
rows++;
|
|
|
|
|
|
/* wind back bottom pointer by two pages */
|
|
|
- for (; bottom != NULL &&
|
|
|
- TAILQ_NEXT(bottom, entries) != NULL &&
|
|
|
- rows <= ws.ws_row; rows++)
|
|
|
+ for (; bottom != NULL && TAILQ_NEXT(bottom, entries) != NULL &&
|
|
|
+ rows <= ws.ws_row; rows++)
|
|
|
bottom = TAILQ_NEXT(bottom, entries);
|
|
|
|
|
|
if (rows <= 0) {
|
|
|
@@ -290,9 +289,8 @@ scrolldown(char *buf, size_t size)
|
|
|
int rows = ws.ws_row;
|
|
|
|
|
|
/* print one page */
|
|
|
- for (; rows > 0 &&
|
|
|
- bottom != NULL &&
|
|
|
- TAILQ_PREV(bottom, tailhead, entries) != NULL; rows--) {
|
|
|
+ for (; rows > 0 && bottom != NULL &&
|
|
|
+ TAILQ_PREV(bottom, tailhead, entries) != NULL; rows--) {
|
|
|
bottom = TAILQ_PREV(bottom, tailhead, entries);
|
|
|
write(STDOUT_FILENO, bottom->buf, bottom->size);
|
|
|
}
|