about summary refs log tree commit diff
path: root/Src/exec.c
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>2000-01-31 09:56:01 +0000
committerTanaka Akira <akr@users.sourceforge.net>2000-01-31 09:56:01 +0000
commit059a529e9cdc778222868a0865b4d75070ac4a43 (patch)
treeaf969dcd5260c59f733274ff0fdb9be4d6923274 /Src/exec.c
parent0913d4b8f8f54cb33b377667581468ab32152ad3 (diff)
downloadzsh-059a529e9cdc778222868a0865b4d75070ac4a43.tar.gz
zsh-059a529e9cdc778222868a0865b4d75070ac4a43.tar.xz
zsh-059a529e9cdc778222868a0865b4d75070ac4a43.zip
zsh-workers/9487
Diffstat (limited to 'Src/exec.c')
-rw-r--r--Src/exec.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/Src/exec.c b/Src/exec.c
index ac0288be0..4c9c291c4 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -2917,25 +2917,24 @@ execfuncdef(Estate state, int do_exec)
 {
     Shfunc shf;
     char *s;
-    int signum, nprg, npats, num, len, plen, i;
-    Wordcode beg = state->pc, end, names;
+    int signum, nprg, npats, len, plen, i;
+    Wordcode beg = state->pc, end;
     Eprog prog;
     Patprog *pp;
+    LinkList names;
 
     end = beg + WC_FUNCDEF_SKIP(state->pc[-1]);
-    num = state->pc[0];
-    names = state->pc + 1;
-    nprg = state->pc[1 + num] - 4;
-    npats = state->pc[2 + num];
-
-    state->pc += num + 3;
+    names = ecgetlist(state, *state->pc++, 1);
+    nprg = *state->pc++ - 4;
+    npats = *state->pc++;
 
     plen = (end - state->pc) * sizeof(wordcode);
     len = plen + (npats * sizeof(Patprog));
 
+    execsubst(names);
+
     PERMALLOC {
-	while (num--) {
-	    s = ecrawstr(state->prog, names++);
+	while ((s = (char *) ugetnode(names))) {
 	    prog = (Eprog) zalloc(sizeof(*prog));
 	    prog->heap = 0;
 	    prog->len = len;