Jochen Sprickerhof 5 年 前
コミット
4b78ac4d9f
1 ファイル変更5 行追加7 行削除
  1. 5 7
      scroll.c

+ 5 - 7
scroll.c

@@ -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);
 	}