From f58869d0728fb62e3f6adda3c835ccbd2b2859c7 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Wed, 27 Mar 2019 19:06:23 +0100 Subject: [PATCH] tweaks: put the unblocking of SIGWINCHes in a better place The blocking is needed only during the wait(), so unblock SIGWINCH again right after the wait() -- also to have the unblocking before a possible error exit. --- src/text.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/text.c b/src/text.c index 98441392..5f8843e7 100644 --- a/src/text.c +++ b/src/text.c @@ -2653,12 +2653,14 @@ const char *do_alt_speller(char *tempfile_name) return _("Could not fork"); #ifndef NANO_TINY - /* Block SIGWINCHes so the spell checker doesn't get any. */ + /* Block SIGWINCHes while waiting for the alternate spell checker's end, + * so nano doesn't get pushed past the wait(). */ allow_sigwinch(FALSE); #endif - - /* Wait for the alternate spell checker to finish. */ wait(&alt_spell_status); +#ifndef NANO_TINY + allow_sigwinch(TRUE); +#endif /* Reenter curses mode. */ doupdate(); @@ -2711,11 +2713,6 @@ const char *do_alt_speller(char *tempfile_name) adjust_viewport(STATIONARY); } -#ifndef NANO_TINY - /* Unblock SIGWINCHes again. */ - allow_sigwinch(TRUE); -#endif - return NULL; }