rc: fix local variables in functions

reported by micah stetson:

fn foo { echo $bar }
bar=baz foo
This commit is contained in:
Russ Cox 2008-08-14 10:29:29 -04:00
parent 0e430b25b2
commit 362264eb51
2 changed files with 4 additions and 4 deletions

View file

@ -130,7 +130,7 @@ execfunc(var *func)
starval = runq->argv->words;
runq->argv->words = 0;
poplist();
start(func->fn, func->pc, (struct var *)0);
start(func->fn, func->pc, runq->local);
runq->local = newvar(strdup("*"), runq->local);
runq->local->val = starval;
runq->local->changed = 1;