summaryrefslogtreecommitdiff
path: root/src/ex_docmd.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-01-02 15:26:27 +0100
committerBram Moolenaar <Bram@vim.org>2017-01-02 15:26:27 +0100
commit777b30f827bcbe10a40640b1bf0361cb93a16be1 (patch)
tree73dc6a7c70a6d3a79e74817c92d0d5d302982dc9 /src/ex_docmd.c
parent54b2bfa399017ebae76ed62f21578261d1b55c1f (diff)
downloadvim-777b30f827bcbe10a40640b1bf0361cb93a16be1.zip
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'.
Diffstat (limited to 'src/ex_docmd.c')
-rw-r--r--src/ex_docmd.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index 1af60abd2..eebdcffb4 100644
--- 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