# HG changeset patch # User Bram Moolenaar # Date 1542678306 -3600 # Node ID 35c2d164a6306e44dc65c90474e1e8a3351506f5 # Parent f6b3fe138e84f322a3bc59c6a68867e5703d624b patch 8.1.0537: ui_breakcheck() may be called recursively commit https://github.com/vim/vim/commit/48d23bb4de3dd37ba0d0b22e7c39d6b894cb1f75 Author: Bram Moolenaar Date: Tue Nov 20 02:42:43 2018 +0100 patch 8.1.0537: ui_breakcheck() may be called recursively Problem: ui_breakcheck() may be called recursively, which doesn't work. Solution: When called recursively, just return. (James McCoy, closes https://github.com/vim/vim/issues/3617) diff --git a/src/ui.c b/src/ui.c --- 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; - - /* We do not want gui_resize_shell() to redraw the screen here. */ + static int recursive = FALSE; + int save_updating_screen = updating_screen; + + // 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; } /***************************************************************************** diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -793,6 +793,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 537, +/**/ 536, /**/ 535,