patch 9.0.2183: Maximum callback depth is not configurable
Problem: Maximum callback depth is not configurable.
Solution: Revert patch 9.0.2103. Set 'maxfuncdepth' in test.
(zeertzjq)
fixes: #13732
closes: #13736
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/userfunc.c b/src/userfunc.c
index ea03e78..c0a2487 100644
--- a/src/userfunc.c
+++ b/src/userfunc.c
@@ -14,9 +14,6 @@
#include "vim.h"
#if defined(FEAT_EVAL) || defined(PROTO)
-
-#define MAX_CALLBACK_DEPTH 20
-
/*
* All user-defined functions are found in this hashtable.
*/
@@ -3603,7 +3600,7 @@
if (callback->cb_name == NULL || *callback->cb_name == NUL)
return FAIL;
- if (callback_depth > MAX_CALLBACK_DEPTH)
+ if (callback_depth > p_mfd)
{
emsg(_(e_command_too_recursive));
return FAIL;