about summary refs log tree commit diff
path: root/Src/exec.c
diff options
context:
space:
mode:
authorDaniel Shahaf <d.s@daniel.shahaf.name>2020-03-19 18:00:16 +0000
committerDaniel Shahaf <d.s@daniel.shahaf.name>2020-03-22 02:23:53 +0000
commit386d9ac8ff961b8f0333d09511e927ab31011658 (patch)
tree442bdeb53c2f867ab5c5878dd1c45ea49dbd6c76 /Src/exec.c
parenta3c6c5513dcfc25d952735449bf6da476d905184 (diff)
downloadzsh-386d9ac8ff961b8f0333d09511e927ab31011658.tar.gz
zsh-386d9ac8ff961b8f0333d09511e927ab31011658.tar.xz
zsh-386d9ac8ff961b8f0333d09511e927ab31011658.zip
45583/0008: Add the 'function -T' syntax.
Config/version.mk was bumped in the previous commit.
Diffstat (limited to 'Src/exec.c')
-rw-r--r--Src/exec.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/Src/exec.c b/Src/exec.c
index 3c3fcfa3e..2b8e2167f 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -5157,23 +5157,25 @@ execfuncdef(Estate state, Eprog redir_prog)
 {
     Shfunc shf;
     char *s = NULL;
-    int signum, nprg, sbeg, nstrs, npats, len, plen, i, htok = 0, ret = 0;
+    int signum, nprg, sbeg, nstrs, npats, do_tracing, len, plen, i, htok = 0, ret = 0;
     int anon_func = 0;
     Wordcode beg = state->pc, end;
     Eprog prog;
     Patprog *pp;
     LinkList names;
+    int tracing_flags;
 
     end = beg + WC_FUNCDEF_SKIP(state->pc[-1]);
     names = ecgetlist(state, *state->pc++, EC_DUPTOK, &htok);
     sbeg = *state->pc++;
     nstrs = *state->pc++;
     npats = *state->pc++;
-    (void) *state->pc++;
+    do_tracing = *state->pc++;
 
     nprg = (end - state->pc);
     plen = nprg * sizeof(wordcode);
     len = plen + (npats * sizeof(Patprog)) + nstrs;
+    tracing_flags = do_tracing ? PM_TAGGED_LOCAL : 0;
 
     if (htok && names) {
 	execsubst(names);
@@ -5223,7 +5225,7 @@ execfuncdef(Estate state, Eprog redir_prog)
 
 	shf = (Shfunc) zalloc(sizeof(*shf));
 	shf->funcdef = prog;
-	shf->node.flags = 0;
+	shf->node.flags = tracing_flags;
 	/* No dircache here, not a directory */
 	shf->filename = ztrdup(scriptfilename);
 	shf->lineno =