mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-10 00:31:07 +02:00
zsh-workers/9487
This commit is contained in:
parent
0913d4b8f8
commit
059a529e9c
1 changed files with 9 additions and 10 deletions
19
Src/exec.c
19
Src/exec.c
|
@ -2917,25 +2917,24 @@ execfuncdef(Estate state, int do_exec)
|
||||||
{
|
{
|
||||||
Shfunc shf;
|
Shfunc shf;
|
||||||
char *s;
|
char *s;
|
||||||
int signum, nprg, npats, num, len, plen, i;
|
int signum, nprg, npats, len, plen, i;
|
||||||
Wordcode beg = state->pc, end, names;
|
Wordcode beg = state->pc, end;
|
||||||
Eprog prog;
|
Eprog prog;
|
||||||
Patprog *pp;
|
Patprog *pp;
|
||||||
|
LinkList names;
|
||||||
|
|
||||||
end = beg + WC_FUNCDEF_SKIP(state->pc[-1]);
|
end = beg + WC_FUNCDEF_SKIP(state->pc[-1]);
|
||||||
num = state->pc[0];
|
names = ecgetlist(state, *state->pc++, 1);
|
||||||
names = state->pc + 1;
|
nprg = *state->pc++ - 4;
|
||||||
nprg = state->pc[1 + num] - 4;
|
npats = *state->pc++;
|
||||||
npats = state->pc[2 + num];
|
|
||||||
|
|
||||||
state->pc += num + 3;
|
|
||||||
|
|
||||||
plen = (end - state->pc) * sizeof(wordcode);
|
plen = (end - state->pc) * sizeof(wordcode);
|
||||||
len = plen + (npats * sizeof(Patprog));
|
len = plen + (npats * sizeof(Patprog));
|
||||||
|
|
||||||
|
execsubst(names);
|
||||||
|
|
||||||
PERMALLOC {
|
PERMALLOC {
|
||||||
while (num--) {
|
while ((s = (char *) ugetnode(names))) {
|
||||||
s = ecrawstr(state->prog, names++);
|
|
||||||
prog = (Eprog) zalloc(sizeof(*prog));
|
prog = (Eprog) zalloc(sizeof(*prog));
|
||||||
prog->heap = 0;
|
prog->heap = 0;
|
||||||
prog->len = len;
|
prog->len = len;
|
||||||
|
|
Loading…
Reference in a new issue