Commit bc6aae89c2eb2254cc7aa4297cd98af69ff62ea9

Stefan Sperling 2019-02-21T22:13:12

tog: don't keep loading more commits in scroll_down()

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
diff --git a/tog/tog.c b/tog/tog.c
index 3bdc7f3..00edfdb 100644
--- a/tog/tog.c
+++ b/tog/tog.c
@@ -1204,11 +1204,12 @@ scroll_down(struct commit_queue_entry **first_displayed_entry, int maxscroll,
 
 	do {
 		pentry = TAILQ_NEXT(*last_displayed_entry, entry);
+		if (pentry == NULL)
+			*commits_needed = maxscroll + 20;
 		while (pentry == NULL) {
 			int errcode;
 			if (*log_complete)
 				break;
-			*commits_needed = maxscroll + 20;
 			errcode = pthread_cond_signal(need_commits);
 			if (errcode)
 				return got_error_set_errno(errcode);