summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoraiju <devnull@localhost>2017-05-26 00:01:53 +0000
committeraiju <devnull@localhost>2017-05-26 00:01:53 +0000
commitce17224eaf159e48b4cbb40c437bb2b3e008ca9e (patch)
tree4fc60dd7cfebfe480df6fc9976d852b25fdea546
parent5fb666453a7b0457ae0ba97bccfab04899058568 (diff)
downloadplan9front-ce17224eaf159e48b4cbb40c437bb2b3e008ca9e.tar.xz
?a: getc() needs to increment lineno if it gets \n from peekc
-rw-r--r--sys/src/cmd/cc/lexbody2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/src/cmd/cc/lexbody b/sys/src/cmd/cc/lexbody
index 48c5ed19e..a22c6efba 100644
--- a/sys/src/cmd/cc/lexbody
+++ b/sys/src/cmd/cc/lexbody
@@ -458,6 +458,8 @@ getc(void)
c = peekc;
if(c != IGN) {
peekc = IGN;
+ if(c == '\n')
+ lineno++;
return c;
}
c = GETC();