nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit 2d204bcbfd92898d0b60522c19bd25d0917b3de8
parent 3e609ee4c72d0fe1e58a7743ef013ba29480012a
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Mon, 29 Jun 2020 11:25:57 +0200

rcfile: restore terminal settings when exiting upon excessive unbindings

This fixes https://savannah.gnu.org/bugs/?58671.

Bug existed since commit 24cdf78a from two weeks ago.

Diffstat:
Msrc/rcfile.c | 17+++++++----------
1 file changed, 7 insertions(+), 10 deletions(-)

diff --git a/src/rcfile.c b/src/rcfile.c @@ -1318,16 +1318,13 @@ static void check_vitals_mapped(void) for (int v = 0; v < VITALS; v++) { for (funcstruct *f = allfuncs; f != NULL; f = f->next) { if (f->func == vitals[v] && f->menus & inmenus[v]) { - const keystruct *s = first_sc_for(inmenus[v], f->func); - if (!s) { - fprintf(stderr, _("No key is bound to function '%s' in " - "menu '%s'. Exiting.\n"), f->desc, - menu_to_name(inmenus[v])); - fprintf(stderr, _("If needed, use nano with the -I option " - "to adjust your nanorc settings.\n")); - exit(1); - } - break; + if (first_sc_for(inmenus[v], f->func) == NULL) { + jot_error(N_("No key is bound to function '%s' in menu '%s'. " + " Exiting.\n"), f->desc, menu_to_name(inmenus[v])); + die(_("If needed, use nano with the -I option " + "to adjust your nanorc settings.\n")); + } else + break; } } }