"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Omar Polo <op@omarpolo.com>
Subject:
tog reset search after C-l
To:
gameoftrees@openbsd.org
Date:
Sat, 18 Jun 2022 17:41:59 +0200

Download raw body.

Thread
upon C-l (Control-L), tog refreshes the data but keeps around the
matched_entry and search_entry.  These now points to free'd memory and
segfaults tog when one press 'n'.

to reproduce: search for something, press C-l and then 'n'.

since C-l resets also the scroll position I figured it didn't seem
strange to also loose the current matched entry.

ok?

diff 0fe55807cf233278482e51afcee4b60d5c974340 /home/op/w/got
blob - 8782d2289745425a1fdaecbd1edbcab6c230e7e6
file + tog/tog.c
--- tog/tog.c
+++ tog/tog.c
@@ -2800,6 +2800,8 @@ input_log_view(struct tog_view **new_view, struct tog_
 		s->thread_args.log_complete = 0;
 		s->quit = 0;
 		s->thread_args.commits_needed = view->nlines;
+		s->matched_entry = NULL;
+		s->search_entry = NULL;
 		break;
 	case 'r':
 		if (view_is_parent_view(view))