nano

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

commit 6f07f2b44463db9a7e5cd0b1ed0b764a08224fc0
parent f58869d0728fb62e3f6adda3c835ccbd2b2859c7
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Wed, 27 Mar 2019 19:44:50 +0100

tweaks: rename a function plus parameter, to stay closer to what it does

Diffstat:
Msrc/nano.c | 7+++----
Msrc/proto.h | 2+-
Msrc/text.c | 4++--
3 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/src/nano.c b/src/nano.c @@ -1362,15 +1362,14 @@ void regenerate_screen(void) total_refresh(); } -/* If allow is FALSE, block any SIGWINCH signal. If allow is TRUE, - * unblock SIGWINCH so any pending ones can be dealt with. */ -void allow_sigwinch(bool allow) +/* Block or unblock the SIGWINCH signal, depending on the blockit parameter. */ +void block_sigwinch(bool blockit) { sigset_t winch; sigemptyset(&winch); sigaddset(&winch, SIGWINCH); - sigprocmask(allow ? SIG_UNBLOCK : SIG_BLOCK, &winch, NULL); + sigprocmask(blockit ? SIG_BLOCK : SIG_UNBLOCK, &winch, NULL); } /* Handle the global toggle specified in flag. */ diff --git a/src/proto.h b/src/proto.h @@ -427,7 +427,7 @@ RETSIGTYPE do_continue(int signal); #ifndef NANO_TINY RETSIGTYPE handle_sigwinch(int signal); void regenerate_screen(void); -void allow_sigwinch(bool allow); +void block_sigwinch(bool blockit); void do_toggle(int flag); void enable_signals(void); #endif diff --git a/src/text.c b/src/text.c @@ -2655,11 +2655,11 @@ const char *do_alt_speller(char *tempfile_name) #ifndef NANO_TINY /* Block SIGWINCHes while waiting for the alternate spell checker's end, * so nano doesn't get pushed past the wait(). */ - allow_sigwinch(FALSE); + block_sigwinch(TRUE); #endif wait(&alt_spell_status); #ifndef NANO_TINY - allow_sigwinch(TRUE); + block_sigwinch(FALSE); #endif /* Reenter curses mode. */