commit 3f695b8fb7b04dcc7634320f61f5a242fee702ff
parent 55699dc17198e9caf27b9adf39732552c9024bd1
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Sat, 30 Mar 2019 19:23:15 +0100
speller: resizing can happen also when configured with --enable-tiny
When nano was configured with --enable-tiny --enable-speller, the
block_sigwinch() function should be available, to mask SIGWINCHes
during a spell check.
Diffstat:
3 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/src/nano.c b/src/nano.c
@@ -1300,6 +1300,18 @@ RETSIGTYPE do_continue(int signal)
ungetch(KEY_FLUSH);
}
+#ifdef ENABLE_SPELLER
+/* 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(blockit ? SIG_BLOCK : SIG_UNBLOCK, &winch, NULL);
+}
+#endif
+
#ifndef NANO_TINY
/* Handler for SIGWINCH (window size change). */
RETSIGTYPE handle_sigwinch(int signal)
@@ -1362,16 +1374,6 @@ void regenerate_screen(void)
total_refresh();
}
-/* 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(blockit ? SIG_BLOCK : SIG_UNBLOCK, &winch, NULL);
-}
-
/* Handle the global toggle specified in flag. */
void do_toggle(int flag)
{
diff --git a/src/proto.h b/src/proto.h
@@ -424,10 +424,12 @@ RETSIGTYPE handle_crash(int signal);
#endif
RETSIGTYPE do_suspend(int signal);
RETSIGTYPE do_continue(int signal);
+#ifdef ENABLE_SPELLER
+void block_sigwinch(bool blockit);
+#endif
#ifndef NANO_TINY
RETSIGTYPE handle_sigwinch(int signal);
void regenerate_screen(void);
-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
@@ -2654,15 +2654,11 @@ const char *do_alt_speller(char *tempfile_name)
} else if (pid_spell < 0)
return _("Could not fork");
-#ifndef NANO_TINY
/* Block SIGWINCHes while waiting for the alternate spell checker's end,
* so nano doesn't get pushed past the wait(). */
block_sigwinch(TRUE);
-#endif
wait(&alt_spell_status);
-#ifndef NANO_TINY
block_sigwinch(FALSE);
-#endif
/* Reenter curses mode. */
doupdate();