commit fb59748f6b2d9108022ebf444586386f085fd134 from: Stefan Sperling date: Sat Dec 05 16:58:37 2020 UTC garbage-collect pointless main_view variable in view_loop() This short-cut is not necessary and was buggy: The pointer was not updated even if the main view had changed. Removing this code fixes a problem on FreeBSD where pressing 'q' in a child view caused tog to exit. ok naddy commit - 2b7798554376be53923852de4f57b34f3ebc9cec commit + fb59748f6b2d9108022ebf444586386f085fd134 blob - 38cc44f44c8d28152deb170944026300861ddbe5 blob + 1497322b4643af8cb574d4b4e0364308dad35b2f --- tog/tog.c +++ tog/tog.c @@ -959,7 +959,7 @@ view_loop(struct tog_view *view) { const struct got_error *err = NULL; struct tog_view_list_head views; - struct tog_view *new_view, *main_view; + struct tog_view *new_view; int fast_refresh = 10; int done = 0, errcode; @@ -970,7 +970,6 @@ view_loop(struct tog_view *view) TAILQ_INIT(&views); TAILQ_INSERT_HEAD(&views, view, entry); - main_view = view; view->focussed = 1; err = view->show(view); if (err) @@ -1001,7 +1000,7 @@ view_loop(struct tog_view *view) TAILQ_REMOVE(&views, view, entry); err = view_close(view); - if (err || (view == main_view && new_view == NULL)) + if (err) goto done; view = NULL;