From 33e1bf14350ff05a16374d73a5f16cc81ae890ee Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Tue, 28 May 2019 12:19:49 +0200 Subject: [PATCH] startup: remove the now-unneeded workaround for a SIGWINCH during input The previous commit makes that the terminal's state is only resaved when standard input is actually reconnected to the terminal, and leaves it unchanged otherwise. Apparently this is enough to fix https://savannah.gnu.org/bugs/?56394. --- src/nano.c | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/src/nano.c b/src/nano.c index 5d148771..6bbf8d57 100644 --- a/src/nano.c +++ b/src/nano.c @@ -60,11 +60,6 @@ static struct termios oldterm; # define tcgetattr(...) #endif -#ifndef NANO_TINY -bool size_changed = FALSE; - /* A secondary flag that is set to TRUE when a SIGWINCH occurs. */ -#endif - static struct sigaction act; /* Used to set up all our fun signal handlers. */ @@ -1086,13 +1081,9 @@ void reconnect_and_store_state(void) dup2(thetty, 0); close(thetty); - /* If there were no signals, store the current state of the terminal. */ - if (!control_C_was_pressed) { -#ifndef NANO_TINY - if (!size_changed) -#endif - tcgetattr(0, &oldterm); - } + /* If input was not cut short, store the current state of the terminal. */ + if (!control_C_was_pressed) + tcgetattr(0, &oldterm); } /* Read whatever comes from standard input into a new buffer. */ @@ -1290,8 +1281,6 @@ RETSIGTYPE handle_sigwinch(int signal) { /* Let the input routine know that a SIGWINCH has occurred. */ the_window_resized = TRUE; - /* Set a second flag too, for when reading from standard input. */ - size_changed = TRUE; } /* Reinitialize and redraw the screen completely. */