diff src/ex_docmd.c @ 10488:89200fa1d174 v8.0.0137

commit https://github.com/vim/vim/commit/777b30f827bcbe10a40640b1bf0361cb93a16be1 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Jan 2 15:26:27 2017 +0100 patch 8.0.0137 Problem: When 'maxfuncdepth' is set above 200 the nesting is limited to 200. (Brett Stahlman) Solution: Allow for Ex command recursion depending on 'maxfuncdepth'.
author Christian Brabandt <cb@256bit.org>
date Mon, 02 Jan 2017 15:30:04 +0100
parents c7de1536780a
children 8f2191b56d52
line wrap: on
line diff
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -787,8 +787,9 @@ do_cmdline(
 #endif
 
     /* It's possible to create an endless loop with ":execute", catch that
-     * here.  The value of 200 allows nested function calls, ":source", etc. */
-    if (call_depth == 200)
+     * here.  The value of 200 allows nested function calls, ":source", etc.
+     * Allow 200 or 'maxfuncdepth', whatever is larger. */
+    if (call_depth >= 200 && call_depth >= p_mfd)
     {
 	EMSG(_("E169: Command too recursive"));
 #ifdef FEAT_EVAL