about summary refs log tree commit diff
path: root/Src/Modules
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>2000-01-21 16:28:40 +0000
committerTanaka Akira <akr@users.sourceforge.net>2000-01-21 16:28:40 +0000
commit7c109429799172a7bd606593ecf58b8d49b5790f (patch)
tree7e686d6fde42a876adf503992d5ed4b7fb6aa703 /Src/Modules
parentefb93ed6a697d24ac2340b7c10f6ec86ee48d1e2 (diff)
downloadzsh-7c109429799172a7bd606593ecf58b8d49b5790f.tar.gz
zsh-7c109429799172a7bd606593ecf58b8d49b5790f.tar.xz
zsh-7c109429799172a7bd606593ecf58b8d49b5790f.zip
zsh-workers/9401
Diffstat (limited to 'Src/Modules')
-rw-r--r--Src/Modules/parameter.c44
1 files changed, 7 insertions, 37 deletions
diff --git a/Src/Modules/parameter.c b/Src/Modules/parameter.c
index 219ad5098..be8b8ad75 100644
--- a/Src/Modules/parameter.c
+++ b/Src/Modules/parameter.c
@@ -555,42 +555,25 @@ scanpmdisfunctions(HashTable ht, ScanFunc func, int flags)
 
 /* Functions for the funcstack special parameter. */
 
-static LinkList funcstack;
-
 /**/
 static char **
 funcstackgetfn(Param pm)
 {
+    Funcstack f;
+    int num;
     char **ret, **p;
-    LinkNode node;
 
-    ret = (char **) zhalloc((countlinknodes(funcstack) + 1) * sizeof(char *));
+    for (f = funcstack, num = 0; f; f = f->prev, num++);
+
+    ret = (char **) zhalloc((num + 1) * sizeof(char *));
 
-    for (node = firstnode(funcstack), p = ret; node; incnode(node), p++)
-	*p = (char *) getdata(node);
+    for (f = funcstack, p = ret; f; f = f->prev, p++)
+	*p = f->name;
     *p = NULL;
 
     return ret;
 }
 
-/**/
-static int
-func_wrapper(Eprog prog, FuncWrap w, char *name)
-{
-    PERMALLOC {
-	pushnode(funcstack, ztrdup(name));
-    } LASTALLOC;
-
-    runshfunc(prog, w, name);
-
-    DPUTS(strcmp(name, (char *) getdata(firstnode(funcstack))),
-	  "funcstack wrapper with wrong function");
-
-    zsfree((char *) remnode(funcstack, firstnode(funcstack)));
-
-    return 0;
-}
-
 /* Functions for the builtins special parameter. */
 
 /**/
@@ -1937,10 +1920,6 @@ static struct pardef partab[] = {
     { NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL }
 };
 
-static struct funcwrap wrapper[] = {
-    WRAPDEF(func_wrapper),
-};
-
 /**/
 int
 setup_(Module m)
@@ -1980,12 +1959,6 @@ boot_(Module m)
 	    def->pm->unsetfn = def->unsetfn;
 	}
     }
-    PERMALLOC {
-	funcstack = newlinklist();
-    } LASTALLOC;
-
-    addwrapper(m, wrapper);
-
     return 0;
 }
 
@@ -2005,9 +1978,6 @@ cleanup_(Module m)
 	    unsetparam_pm(pm, 0, 1);
 	}
     }
-    deletewrapper(m, wrapper);
-    freelinklist(funcstack, freestr);
-
     return 0;
 }