nano

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

commit 1e5064ef84cd4ceb5e5df7abfb8ac09bb10877b6
parent 5b40bad6296c14102c1e25d7c24e9aa756373c4c
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Mon, 23 Apr 2018 12:19:25 +0200

tweaks: fix a typo, remove a blank line, and improve some comments

Diffstat:
Msrc/history.c | 2+-
Msrc/nano.c | 1-
Msrc/text.c | 15+++++----------
3 files changed, 6 insertions(+), 12 deletions(-)

diff --git a/src/history.c b/src/history.c @@ -227,7 +227,7 @@ char *get_history_completion(filestruct **h, char *s, size_t len) * match, or len is 0. Return s. */ return (char *)s; } -#endif /* ENSABLE_TABCOMP */ +#endif /* ENABLE_TABCOMP */ void history_error(const char *msg, ...) { diff --git a/src/nano.c b/src/nano.c @@ -1487,7 +1487,6 @@ void terminal_init(void) if (!newterm_set) { #endif - raw(); nonl(); noecho(); diff --git a/src/text.c b/src/text.c @@ -1122,13 +1122,11 @@ bool execute_command(const char *command) return FALSE; } - /* Before we start reading the forked command's output, we set - * things up so that Ctrl-C will cancel the new process. */ - - /* Enable interpretation of the special control keys so that we get + /* Re-enable interpretation of the special control keys so that we get * SIGINT when Ctrl-C is pressed. */ enable_signals(); + /* Set things up so that Ctrl-C will terminate the forked process. */ if (sigaction(SIGINT, NULL, &newaction) == -1) { sig_failed = TRUE; nperror("sigaction"); @@ -1140,9 +1138,6 @@ bool execute_command(const char *command) } } - /* Note that now oldaction is the previous SIGINT signal handler, - * to be restored later. */ - f = fdopen(fd[0], "rb"); if (f == NULL) nperror("fdopen"); @@ -1152,12 +1147,12 @@ bool execute_command(const char *command) if (wait(NULL) == -1) nperror("wait"); + /* If it was changed, restore the handler for SIGINT. */ if (!sig_failed && sigaction(SIGINT, &oldaction, NULL) == -1) nperror("sigaction"); - /* Restore the terminal to its previous state. In the process, - * disable interpretation of the special control keys so that we can - * use Ctrl-C for other things. */ + /* Restore the terminal to its desired state, and disable + * interpretation of the special control keys again. */ terminal_init(); return TRUE;