]> granicus.if.org Git - vim/commitdiff
patch 8.1.0537: ui_breakcheck() may be called recursively v8.1.0537
authorBram Moolenaar <Bram@vim.org>
Tue, 20 Nov 2018 01:42:43 +0000 (02:42 +0100)
committerBram Moolenaar <Bram@vim.org>
Tue, 20 Nov 2018 01:42:43 +0000 (02:42 +0100)
Problem:    ui_breakcheck() may be called recursively, which doesn't work.
Solution:   When called recursively, just return. (James McCoy, closes #3617)

src/ui.c
src/version.c

index a1f584e3f91d663d1507d4d7478e2587acb77ef4..5ae0ae38b7f6cd781355bf7c76c0e6420024a50e 100644 (file)
--- 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;
 }
 
 /*****************************************************************************
index c0a5845d57ee25fab565feec14a16d9a2517c5a7..29488c2a77826ec93be5343274f0197e218b2520 100644 (file)
@@ -792,6 +792,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    537,
 /**/
     536,
 /**/