From 47da0c66fb9e8403c09e70792fd406a1476cfaab Mon Sep 17 00:00:00 2001 From: Matthias Kruk Date: Sat, 30 May 2020 23:15:06 +0900 Subject: [PATCH] tokenize: Fix off-by-one bug in the column number --- src/tokenize.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tokenize.c b/src/tokenize.c index 9790f6d..dcfcfe6 100644 --- a/src/tokenize.c +++ b/src/tokenize.c @@ -45,7 +45,7 @@ static char _next = 0; static int _state = STATE_NONE; static int _line = 1; -static int _col = 1; +static int _col = 0; static int _pline = 1; static int _pcol = 1; list_t *tokens = NULL; @@ -70,7 +70,7 @@ int getnext(void) _pline = _line; _pcol = _col; _line++; - _col = 1; + _col = 0; break; case '\t': -- 2.47.3