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

From:
Stefan Sperling <stsp@stsp.name>
Subject:
Re: tog reset search after C-l
To:
Omar Polo <op@omarpolo.com>
Cc:
gameoftrees@openbsd.org
Date:
Sat, 18 Jun 2022 18:08:00 +0200

Download raw body.

Thread
On Sat, Jun 18, 2022 at 05:41:59PM +0200, Omar Polo wrote:
> 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?

Yes, makes sense.

> 
> 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))
> 
>