nano

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

commit 5b40bad6296c14102c1e25d7c24e9aa756373c4c
parent 45f8fc77e0de6e1090d572fc2e49def0b9d62f00
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Mon, 23 Apr 2018 11:58:18 +0200

files: prevent a hang when a call to sigaction() would fail

Don't try to re-enter curses mode when the terminal is not in
the correct state yet.

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

Diffstat:
Msrc/nano.c | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/nano.c b/src/nano.c @@ -1118,12 +1118,12 @@ bool scoop_stdin(void) /* Set things up so that SIGINT will cancel the reading. */ if (sigaction(SIGINT, NULL, &newaction) == -1) { setup_failed = TRUE; - nperror("sigaction"); + perror("sigaction"); } else { newaction.sa_handler = make_a_note; if (sigaction(SIGINT, &newaction, &oldaction) == -1) { setup_failed = TRUE; - nperror("sigaction"); + perror("sigaction"); } } @@ -1156,7 +1156,7 @@ bool scoop_stdin(void) /* If it was changed, restore the handler for SIGINT. */ if (!setup_failed && sigaction(SIGINT, &oldaction, NULL) == -1) - nperror("sigaction"); + perror("sigaction"); terminal_init(); doupdate();