From 3f095c04cdef1e545350a03648c7439eec38fea0 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Sun, 21 Jul 2013 17:52:39 +1000 Subject: [PATCH] scanner: initialise token state properly. We need to call do_strip() at the start to ensure the correct col and indent is used for the first token. Signed-off-by: NeilBrown --- csrc/scanner.mdc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/csrc/scanner.mdc b/csrc/scanner.mdc index 57f9e21..6dda848 100644 --- a/csrc/scanner.mdc +++ b/csrc/scanner.mdc @@ -1107,7 +1107,9 @@ As well as getting tokens, we need to be able to create the memset(state, 0, sizeof(*state)); state->node = code; state->line = code->line_no; + state->col = code->indent; state->conf = conf; + do_strip(state); return state; } void token_close(struct token_state *state) -- 2.43.0