about summary refs log tree commit diff
path: root/Src/exec.c
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-04-15 18:10:10 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-04-15 18:10:10 +0000
commit2a5a899a55fd2bce10efd01c75a4bec5285aa46c (patch)
tree4744bc2f1a6b86fc1b12870be94edf96fdab4879 /Src/exec.c
parent9003d99d16c46b5679da7fcf1f2a41adef495ff9 (diff)
downloadzsh-2a5a899a55fd2bce10efd01c75a4bec5285aa46c.tar.gz
zsh-2a5a899a55fd2bce10efd01c75a4bec5285aa46c.tar.xz
zsh-2a5a899a55fd2bce10efd01c75a4bec5285aa46c.zip
zsh-3.1.5-pws-4 zsh-3.1.5-pws-4
Diffstat (limited to 'Src/exec.c')
-rw-r--r--Src/exec.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/Src/exec.c b/Src/exec.c
index a2d74a9f4..911559a02 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -113,7 +113,12 @@ pid_t cmdoutpid;
  
 /**/
 int cmdoutval;
- 
+
+/* The context in which a shell function is called, see SFC_* in zsh.h. */ 
+
+/**/
+int sfcontext;
+
 /* Stack to save some variables before executing a signal handler function */
 
 /**/
@@ -2771,19 +2776,14 @@ runshfunc(List list, FuncWrap wrap, char *name)
     char *ou;
 
     while (wrap) {
-	wrap->module->flags |= MOD_WRAPPER;
-	wrap->count++;
+	wrap->module->wrapper++;
 	cont = wrap->handler(list, wrap->next, name);
-	wrap->count--;
-	if (!wrap->count) {
-	    wrap->module->flags &= ~MOD_WRAPPER;
+	wrap->module->wrapper--;
 #ifdef DYNAMIC
-	    if (wrap->module->flags & MOD_UNLOAD) {
-		wrap->module->flags &= ~MOD_UNLOAD;
-		unload_module(wrap->module, NULL);
-	    }
+	if (!wrap->module->wrapper &&
+	    (wrap->module->flags & MOD_UNLOAD))
+	    unload_module(wrap->module, NULL);
 #endif
-	}
 	if (!cont)
 	    return;
 	wrap = wrap->next;