summaryrefslogtreecommitdiff
path: root/sys/src/cmd/rc/code.c
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2021-06-22 23:40:11 +0000
committerOri Bernstein <ori@eigenstate.org>2021-06-22 23:40:11 +0000
commit577033228209f28350dc3f75ef9d4ce88dfdf190 (patch)
tree7540037c6ffd83810da4209abbdd6879a484e075 /sys/src/cmd/rc/code.c
parentce73821f3575921e24f839b21c7be60520a9dc42 (diff)
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.
Diffstat (limited to 'sys/src/cmd/rc/code.c')
-rw-r--r--sys/src/cmd/rc/code.c2
1 files changed, 1 insertions, 1 deletions
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);