summary refs log tree commit diff
path: root/Src/params.c
diff options
context:
space:
mode:
authorPeter Stephenson <pws@zsh.org>2017-09-29 16:46:01 +0100
committerPeter Stephenson <pws@zsh.org>2017-10-02 09:44:26 +0100
commit174e560a23e40725cd0b50669a52d831342e5246 (patch)
tree6ded2f3a9cf9dc2fbece05d867f4531c8e55f575 /Src/params.c
parent728f2adfc8daf2c65c5d4130a903635a58c99fb5 (diff)
downloadzsh-174e560a23e40725cd0b50669a52d831342e5246.tar.gz
zsh-174e560a23e40725cd0b50669a52d831342e5246.tar.xz
zsh-174e560a23e40725cd0b50669a52d831342e5246.zip
41787 (plus minor tweaks): use $FUNCSTACK for function nesting depth.
Initialised from existing configuration value.
Diffstat (limited to 'Src/params.c')
-rw-r--r--Src/params.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/Src/params.c b/Src/params.c
index ddf3ce164..31ff0445b 100644
--- a/Src/params.c
+++ b/Src/params.c
@@ -101,6 +101,19 @@ zlong lastval,		/* $?           */
      rprompt_indent,	/* $ZLE_RPROMPT_INDENT */
      ppid,		/* $PPID        */
      zsh_subshell;	/* $ZSH_SUBSHELL */
+
+/* $FUNCNEST    */
+/**/
+mod_export
+zlong zsh_funcnest =
+#ifdef MAX_FUNCTION_DEPTH
+    MAX_FUNCTION_DEPTH
+#else
+    /* Disabled by default but can be enabled at run time */
+    -1
+#endif
+    ;
+
 /**/
 zlong lineno,		/* $LINENO      */
      zoptind,		/* $OPTIND      */
@@ -337,6 +350,7 @@ IPDEF5("COLUMNS", &zterm_columns, zlevar_gsu),
 IPDEF5("LINES", &zterm_lines, zlevar_gsu),
 IPDEF5U("ZLE_RPROMPT_INDENT", &rprompt_indent, rprompt_indent_gsu),
 IPDEF5("SHLVL", &shlvl, varinteger_gsu),
+IPDEF5("FUNCNEST", &zsh_funcnest, varinteger_gsu),
 
 /* Don't import internal integer status variables. */
 #define IPDEF6(A,B,F) {{NULL,A,PM_INTEGER|PM_SPECIAL|PM_DONTIMPORT},BR((void *)B),GSU(F),10,0,NULL,NULL,NULL,0}