From 13fae50e458acf9a1f9f1fcfae5c0d91eb1743ab Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Wed, 3 Dec 2014 15:46:26 +0100 Subject: mds-kbdc: make-tree: m MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/mds-kbdc/make-tree.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'src/mds-kbdc') diff --git a/src/mds-kbdc/make-tree.c b/src/mds-kbdc/make-tree.c index 1a3f854..8f8a7ce 100644 --- a/src/mds-kbdc/make-tree.c +++ b/src/mds-kbdc/make-tree.c @@ -1002,14 +1002,6 @@ static int parse_line(void) { /* TODO make this function less complex */ - line = LINE; - SKIP_SPACES(line); - if (end = strchrnul(line, ' '), end == line) - return 0; - prev_end_char = *end, *end = '\0'; - original = line; - too_few = 0; - redo: if (in_array) { @@ -1334,7 +1326,17 @@ int parse_to_tree(const char* restrict filename, mds_kbdc_parsed_t* restrict res /* Parse the file. */ for (line_i = 0, line_n = result->source_code->line_count; line_i < line_n; line_i++) - parse_line(); + { + line = LINE; + SKIP_SPACES(line); + if (end = strchrnul(line, ' '), end == line) + continue; + prev_end_char = *end, *end = '\0'; + original = line; + too_few = 0; + + parse_line(); + } /* Check parsing state. */ -- cgit v1.2.3-70-g09d2