about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBart Schaefer <barts@users.sourceforge.net>2001-07-08 00:32:12 +0000
committerBart Schaefer <barts@users.sourceforge.net>2001-07-08 00:32:12 +0000
commit22faf1fa4b1290f5f7f7389bbef33acc2fcdce05 (patch)
tree49f6aa21c59b59c37f099bcfa20cf8857274310a
parent0467a101dacffaf7b32716708d4557afa9c27c4f (diff)
downloadzsh-22faf1fa4b1290f5f7f7389bbef33acc2fcdce05.tar.gz
zsh-22faf1fa4b1290f5f7f7389bbef33acc2fcdce05.tar.xz
zsh-22faf1fa4b1290f5f7f7389bbef33acc2fcdce05.zip
Suppress XTRACE during user-defined widgets.
-rw-r--r--Src/Zle/zle_main.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/Src/Zle/zle_main.c b/Src/Zle/zle_main.c
index 1d3f346ab..d46d3b537 100644
--- a/Src/Zle/zle_main.c
+++ b/Src/Zle/zle_main.c
@@ -672,7 +672,8 @@ execzlefunc(Thingy func, char **args)
 	}
 	r = 1;
     } else {
-	Eprog prog = getshfunc(w->u.fnnam);
+	Shfunc shf = (Shfunc) shfunctab->getnode(shfunctab, w->u.fnnam);
+	Eprog prog = (shf ? shf->funcdef : &dummy_eprog);
 
 	if(prog == &dummy_eprog) {
 	    /* the shell function doesn't exist */
@@ -685,6 +686,7 @@ execzlefunc(Thingy func, char **args)
 	    ret = 1;
 	} else {
 	    int osc = sfcontext, osi = movefd(0), olv = lastval;
+	    int oxt = isset(XTRACE);
 	    LinkList largs = NULL;
 
 	    if (*args) {
@@ -696,7 +698,9 @@ execzlefunc(Thingy func, char **args)
 	    startparamscope();
 	    makezleparams(0);
 	    sfcontext = SFC_WIDGET;
-	    doshfunc(w->u.fnnam, prog, largs, 0, 0);
+	    opts[XTRACE] = 0;
+	    doshfunc(w->u.fnnam, prog, largs, shf->flags, 0);
+	    opts[XTRACE] = oxt;
 	    ret = lastval;
 	    lastval = olv;
 	    sfcontext = osc;