Problem: Weird autocmd may cause arglist to be changed recursively.
Solution: Prevent recursively changing the argument list. (Christian
Brabandt, closes #2472)
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)
FreeWild(count, files);
if (al == &global_alist)
arg_had_last = FALSE;
+
+ --recursive;
}
/*
EXTERN char_u e_invalidreg[] INIT(= N_("E850: Invalid register name"));
#endif
EXTERN char_u e_dirnotf[] INIT(= N_("E919: Directory not found in '%s': \"%s\""));
+#ifdef FEAT_AUTOCMD
+EXTERN char_u e_au_recursive[] INIT(= N_("E952: Autocommand caused recursive behavior"));
+#endif
#ifdef FEAT_GUI_MAC
EXTERN short disallow_gui INIT(= FALSE);
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 1485,
/**/
1484,
/**/