1
0
forked from aniani/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 #2472)
This commit is contained in:
Bram Moolenaar
2018-02-09 17:50:28 +01:00
parent a15ef4588c
commit 9e33efd152
3 changed files with 17 additions and 0 deletions

View File

@@ -8058,6 +8058,16 @@ alist_set(
int fnum_len)
{
int i;
static int recursive = 0;
if (recursive)
{
#ifdef FEAT_AUTOCMD
EMSG(_(e_au_recursive));
#endif
return;
}
++recursive;
alist_clear(al);
if (ga_grow(&al->al_ga, count) == OK)
@@ -8087,6 +8097,8 @@ alist_set(
FreeWild(count, files);
if (al == &global_alist)
arg_had_last = FALSE;
--recursive;
}
/*