Commit Diff


commit - f2d4ba2a35c7888ee5c400f7353f73dd594d315f
commit + 20be8d9680a0c664f92ec722c0bb963c25c0948a
blob - 326e696735358e294b6b5eb864cfd1d1f6a785ad
blob + 1ed6fb4840a74facfb6a7912f94e1803372a1d9b
--- tog/tog.c
+++ tog/tog.c
@@ -1742,8 +1742,12 @@ search_next_log_view(struct tog_view *view)
 		else
 			entry = TAILQ_PREV(s->matched_entry,
 			    commit_queue_head, entry);
-	} else
-		entry = TAILQ_FIRST(&s->commits.head);
+	} else {
+		if (view->searching == TOG_SEARCH_FORWARD)
+			entry = TAILQ_FIRST(&s->commits.head);
+		else
+			entry = TAILQ_LAST(&s->commits.head, commit_queue_head);
+	}
 
 	while (1) {
 		if (entry == NULL) {