summaryrefslogtreecommitdiff
path: root/src/ui.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-11-20 02:42:43 +0100
committerBram Moolenaar <Bram@vim.org>2018-11-20 02:42:43 +0100
commit48d23bb4de3dd37ba0d0b22e7c39d6b894cb1f75 (patch)
tree699b85358789af710c00d398eba88c89632f792f /src/ui.c
parentaddc156c38d442367854f71baee31f2eb003c699 (diff)
downloadvim-git-48d23bb4de3dd37ba0d0b22e7c39d6b894cb1f75.tar.gz
patch 8.1.0537: ui_breakcheck() may be called recursivelyv8.1.0537
Problem: ui_breakcheck() may be called recursively, which doesn't work. Solution: When called recursively, just return. (James McCoy, closes #3617)
Diffstat (limited to 'src/ui.c')
-rw-r--r--src/ui.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/ui.c b/src/ui.c
index a1f584e3f..5ae0ae38b 100644
--- a/src/ui.c
+++ b/src/ui.c
@@ -403,9 +403,17 @@ ui_breakcheck(void)
void
ui_breakcheck_force(int force)
{
- int save_updating_screen = updating_screen;
+ static int recursive = FALSE;
+ int save_updating_screen = updating_screen;
- /* We do not want gui_resize_shell() to redraw the screen here. */
+ // We could be called recursively if stderr is redirected, calling
+ // fill_input_buf() calls settmode() when stdin isn't a tty. settmode()
+ // calls vgetorpeek() which calls ui_breakcheck() again.
+ if (recursive)
+ return;
+ recursive = TRUE;
+
+ // We do not want gui_resize_shell() to redraw the screen here.
++updating_screen;
#ifdef FEAT_GUI
@@ -419,6 +427,8 @@ ui_breakcheck_force(int force)
updating_screen = TRUE;
else
reset_updating_screen(FALSE);
+
+ recursive = FALSE;
}
/*****************************************************************************