diff options
author | Ori Bernstein <ori@eigenstate.org> | 2021-06-22 23:40:11 +0000 |
---|---|---|
committer | Ori Bernstein <ori@eigenstate.org> | 2021-06-22 23:40:11 +0000 |
commit | 577033228209f28350dc3f75ef9d4ce88dfdf190 (patch) | |
tree | 7540037c6ffd83810da4209abbdd6879a484e075 /sys/src/cmd/rc/lex.c | |
parent | ce73821f3575921e24f839b21c7be60520a9dc42 (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/lex.c')
-rw-r--r-- | sys/src/cmd/rc/lex.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/sys/src/cmd/rc/lex.c b/sys/src/cmd/rc/lex.c index 52ded7769..3462bed69 100644 --- a/sys/src/cmd/rc/lex.c +++ b/sys/src/cmd/rc/lex.c @@ -28,7 +28,6 @@ int incomm; int lastc; int ndot; int nerror; -int lexline; int nlexpath; int lexpathsz; @@ -53,7 +52,7 @@ advance(void) lastc = future; future = EOF; if(c == '\n') - lexline++; + runq->lexline++; return c; } /* |