commit 3e513e8da1684dbad8fbb71e263e38c18c839a9c
parent 0734cb7680bed852a4fed4ca8eced9ad9b69c53f
Author: Jan Klemkow <j.klemkow@wemelug.de>
Date: Tue, 11 Feb 2020 21:02:06 +0100
prevent bottom from set to NULL again
Diffstat:
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/scroll.c b/scroll.c
@@ -188,8 +188,11 @@ scrollup(void)
/* print one page */
for (; rows > ws.ws_row - first;) {
- if ((bottom = TAILQ_PREV(bottom, tailhead, entries)) == NULL)
+ if (TAILQ_PREV(bottom, tailhead, entries) != NULL)
+ bottom = TAILQ_PREV(bottom, tailhead, entries);
+ else
break;
+
if (--rows > ws.ws_row - first)
write(STDOUT_FILENO, bottom->buf, bottom->size);
else /* last line w/o "/r/n" */