Skip to content

Commit 48d23bb

Browse files
committed
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 #3617)
1 parent addc156 commit 48d23bb

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

src/ui.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -403,9 +403,17 @@ ui_breakcheck(void)
403403
void
404404
ui_breakcheck_force(int force)
405405
{
406-
int save_updating_screen = updating_screen;
406+
static int recursive = FALSE;
407+
int save_updating_screen = updating_screen;
407408

408-
/* We do not want gui_resize_shell() to redraw the screen here. */
409+
// We could be called recursively if stderr is redirected, calling
410+
// fill_input_buf() calls settmode() when stdin isn't a tty. settmode()
411+
// calls vgetorpeek() which calls ui_breakcheck() again.
412+
if (recursive)
413+
return;
414+
recursive = TRUE;
415+
416+
// We do not want gui_resize_shell() to redraw the screen here.
409417
++updating_screen;
410418

411419
#ifdef FEAT_GUI
@@ -419,6 +427,8 @@ ui_breakcheck_force(int force)
419427
updating_screen = TRUE;
420428
else
421429
reset_updating_screen(FALSE);
430+
431+
recursive = FALSE;
422432
}
423433

424434
/*****************************************************************************

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -792,6 +792,8 @@ static char *(features[]) =
792792

793793
static int included_patches[] =
794794
{ /* Add new patch number below this line */
795+
/**/
796+
537,
795797
/**/
796798
536,
797799
/**/

0 commit comments

Comments
 (0)