From 577033228209f28350dc3f75ef9d4ce88dfdf190 Mon Sep 17 00:00:00 2001 From: Ori Bernstein Date: Tue, 22 Jun 2021 23:40:11 +0000 Subject: rc: correct line numbers When loading a file using ".", we could end up with our line numbers thrown off due to the mutation of lexline. Putting lexline into the runq beside the file that we're reading from causes it to get pushed and popped correctly, so that we no longer lose track of our location. --- sys/src/cmd/rc/code.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sys/src/cmd/rc/code.c') diff --git a/sys/src/cmd/rc/code.c b/sys/src/cmd/rc/code.c index d85a12260..89cc43183 100644 --- a/sys/src/cmd/rc/code.c +++ b/sys/src/cmd/rc/code.c @@ -184,7 +184,7 @@ outcode(tree *t, int eflag) emits(strdup(f)); } emitf(Xsrcline); - emiti(lexline); + emiti(runq->lexline); outcode(c1, eflag); emitf(Xunlocal); /* get rid of $* */ emitf(Xreturn); -- cgit v1.2.3