]> git.corax.cc Git - ccc/commitdiff
tokenize: Fix off-by-one bug in the column number
authorMatthias Kruk <m@m10k.eu>
Sat, 30 May 2020 14:15:06 +0000 (23:15 +0900)
committerMatthias Kruk <m@m10k.eu>
Sat, 30 May 2020 14:15:06 +0000 (23:15 +0900)
src/tokenize.c

index 9790f6d9662390418e750a86ab2cec0dd2340a18..dcfcfe6042d042ca3a3aa9b40b9f613e18a69ac5 100644 (file)
@@ -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':