aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/rc/code.c
diff options
context:
space:
mode:
authorRuss Cox <rsc@swtch.com>2008-08-14 10:29:29 -0400
committerRuss Cox <rsc@swtch.com>2008-08-14 10:29:29 -0400
commit362264eb516483d6e2f45ba1e0ab6bcaf2d4f0ee (patch)
tree902303370b73e9e85cbca969ecf8cc5e466f79ea /src/cmd/rc/code.c
parent0e430b25b21cb9e08ccb46c7c5202cd10c13e1dd (diff)
downloadplan9port-362264eb516483d6e2f45ba1e0ab6bcaf2d4f0ee.tar.gz
plan9port-362264eb516483d6e2f45ba1e0ab6bcaf2d4f0ee.tar.bz2
plan9port-362264eb516483d6e2f45ba1e0ab6bcaf2d4f0ee.zip
rc: fix local variables in functions
reported by micah stetson: fn foo { echo $bar } bar=baz foo
Diffstat (limited to 'src/cmd/rc/code.c')
-rw-r--r--src/cmd/rc/code.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/cmd/rc/code.c b/src/cmd/rc/code.c
index 2c33e804..eeaa3ed8 100644
--- a/src/cmd/rc/code.c
+++ b/src/cmd/rc/code.c
@@ -339,9 +339,9 @@ outcode(tree *t, int eflag)
outcode(c0, eflag);
emitf(Xlocal);
}
- t = tt;
- outcode(c2, eflag);
- for(;t->type=='=';t = c2) emitf(Xunlocal);
+ outcode(t, eflag);
+ for(t = tt; t->type=='='; t = c2)
+ emitf(Xunlocal);
}
else{
for(t = tt;t;t = c2){