vim-patch:8.0.1485: weird autocmd may cause arglist to be changed recursively

Problem:    Weird autocmd may cause arglist to be changed recursively.
Solution:   Prevent recursively changing the argument list. (Christian
            Brabandt, closes vim/vim#2472)
9e33efd152
This commit is contained in:
Jan Edmund Lazo
2018-09-29 00:41:02 -04:00
parent 6e146d4132
commit 63b1a7d0cf
2 changed files with 11 additions and 0 deletions

View File

@@ -6536,6 +6536,13 @@ void alist_expand(int *fnum_list, int fnum_len)
void alist_set(alist_T *al, int count, char_u **files, int use_curbuf, int *fnum_list, int fnum_len)
{
int i;
static int recursive = 0;
if (recursive) {
EMSG(_(e_au_recursive));
return;
}
recursive++;
alist_clear(al);
ga_grow(&al->al_ga, count);
@@ -6562,6 +6569,8 @@ void alist_set(alist_T *al, int count, char_u **files, int use_curbuf, int *fnum
if (al == &global_alist)
arg_had_last = FALSE;
recursive--;
}
/*