aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lexer.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lexer.c b/src/lexer.c
index eefeddd..3728147 100644
--- a/src/lexer.c
+++ b/src/lexer.c
@@ -188,9 +188,10 @@ lexer_handle_eachdo(directive_t *directive,
buffer += match->length;
key_match_t *new_match;
+ size_t skip = 0;
while (true) {
- new_match = find_next_key(buffer, 0);
+ new_match = find_next_key(buffer, skip);
if (new_match == NULL) {
printf("Cannot find endeachdo\n");
free(new_match);
@@ -217,6 +218,8 @@ lexer_handle_eachdo(directive_t *directive,
free(new_directive);
free(new_match);
+
+ skip++;
}
operands->content = strndup(buffer, new_match->offset);