Skip to content

Commit

Permalink
patch 8.1.1703: breaking out of loop by checking window pointer insuf…
Browse files Browse the repository at this point in the history
…ficient

Problem:    Breaking out of loop by checking window pointer is insufficient.
Solution:   Check the window ID and the buffer number. (closes #4683)
  • Loading branch information
brammool committed Jul 16, 2019
1 parent c728307 commit 6138640
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/misc2.c
Expand Up @@ -4442,7 +4442,8 @@ has_non_ascii(char_u *s)
void
parse_queued_messages(void)
{
win_T *old_curwin = curwin;
int old_curwin_id = curwin->w_id;
int old_curbuf_fnum = curbuf->b_fnum;
int i;
int save_may_garbage_collect = may_garbage_collect;

Expand Down Expand Up @@ -4494,9 +4495,9 @@ parse_queued_messages(void)

may_garbage_collect = save_may_garbage_collect;

// If the current window changed we need to bail out of the waiting loop.
// E.g. when a job exit callback closes the terminal window.
if (curwin != old_curwin)
// If the current window or buffer changed we need to bail out of the
// waiting loop. E.g. when a job exit callback closes the terminal window.
if (curwin->w_id != old_curwin_id || curbuf->b_fnum != old_curbuf_fnum)
ins_char_typebuf(K_IGNORE);
}
#endif
Expand Down
2 changes: 2 additions & 0 deletions src/version.c
Expand Up @@ -777,6 +777,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1703,
/**/
1702,
/**/
Expand Down

0 comments on commit 6138640

Please sign in to comment.