Jochen Sprickerhof 5 jaren geleden
bovenliggende
commit
dfb4d933d9
1 gewijzigde bestanden met toevoegingen van 2 en 2 verwijderingen
  1. 2 2
      scroll.c

+ 2 - 2
scroll.c

@@ -251,7 +251,7 @@ scrollup(void)
 	for (; TAILQ_NEXT(bottom, entries) != NULL && rows < 2 * ws.ws_row; rows++)
 		bottom = TAILQ_NEXT(bottom, entries);
 
-	if (rows < ws.ws_row) {
+	if (rows <= ws.ws_row) {
 		bottom = TAILQ_LAST(&head, tailhead);
 		return;
 	}
@@ -264,7 +264,7 @@ scrollup(void)
 	write(STDOUT_FILENO, "\033[?25l", 6);
 
 	/* print one page */
-	for (; rows > ws.ws_row && TAILQ_PREV(bottom, tailhead, entries) != NULL; rows--) {
+	for (rows = 0; rows < ws.ws_row; rows++) {
 		bottom = TAILQ_PREV(bottom, tailhead, entries);
 		write(STDOUT_FILENO, bottom->buf, bottom->size);
 	}