summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/lexer.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/core/lexer.c b/core/lexer.c
index 1d1e900..617ba41 100644
--- a/core/lexer.c
+++ b/core/lexer.c
@@ -73,13 +73,17 @@ lexer_consume_single(struct cescal_state *state, bool skip_ws)
}
if ((c = lexer_putback_pop(state)) != '\0') {
- if (lexer_is_ws(c) && !skip_ws) {
+ if (!skip_ws) {
+ return c;
+ }
+
+ if (skip_ws && !lexer_is_ws(c)) {
return c;
}
}
while ((c = readbuf_read(&state->rb, state->in_fd)) != '\0') {
- if (lexer_is_ws(c)) {
+ if (lexer_is_ws(c) && skip_ws) {
continue;
}