diff options
author | Bram Moolenaar <Bram@vim.org> | 2018-02-09 17:50:28 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2018-02-09 17:50:28 +0100 |
commit | 9e33efd1523b85a70533930dd43a26925a2b648c (patch) | |
tree | d8ebb4bd59434d19786961cff90069d352bf2dd7 /src/ex_docmd.c | |
parent | a15ef4588c057da87f64be5b17aef35aaead8ac8 (diff) | |
download | vim-git-9e33efd1523b85a70533930dd43a26925a2b648c.tar.gz |
patch 8.0.1485: weird autocmd may cause arglist to be changed recursivelyv8.0.1485
Problem: Weird autocmd may cause arglist to be changed recursively.
Solution: Prevent recursively changing the argument list. (Christian
Brabandt, closes #2472)
Diffstat (limited to 'src/ex_docmd.c')
-rw-r--r-- | src/ex_docmd.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/ex_docmd.c b/src/ex_docmd.c index cd915c9da..591775f4c 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -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; } /* |