nano-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Nano-devel] [PATCH] speller: block the resizing signal also during an i


From: Benno Schulenberg
Subject: [Nano-devel] [PATCH] speller: block the resizing signal also during an integrated spell check
Date: Sat, 30 Mar 2019 19:50:34 +0100

Because somehow something goes wrong when SIGWINCHes are handled while
reading from a pipe.

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

Bug existed since version 2.4.2, commit 75d64e67.
---
 src/text.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/text.c b/src/text.c
index 3a967b70..b367cf86 100644
--- a/src/text.c
+++ b/src/text.c
@@ -2543,7 +2543,9 @@ const char *do_int_speller(const char *tempfile_name)
                return _("Could not get size of pipe buffer");
        }
 
-       /* Read in the returned spelling errors. */
+       /* Block SIGWINCHes while reading misspelled words from the pipe. */
+       block_sigwinch(TRUE);
+
        totalread = 0;
        buffersize = blocksize + 1;
        misspellings = charalloc(buffersize);
@@ -2559,6 +2561,8 @@ const char *do_int_speller(const char *tempfile_name)
        *pointer = '\0';
        close(uniq_fd[0]);
 
+       block_sigwinch(FALSE);
+
        /* Do any replacements case sensitive, forward, and without regexes. */
        SET(CASE_SENSITIVE);
        UNSET(BACKWARDS_SEARCH);
-- 
2.20.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]