aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/lex.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lex.c b/src/lex.c
index bcb3db58..b7be91e4 100644
--- a/src/lex.c
+++ b/src/lex.c
@@ -162,7 +162,7 @@ BcStatus bc_lex_next(BcLex *l) {
assert(l);
l->last = l->t;
- l->line += l->last == BC_LEX_NLINE;
+ l->line += (l->i != 0 && l->buf[l->i] == '\n');
if (l->last == BC_LEX_EOF) return bc_lex_err(l, BC_ERROR_PARSE_EOF);