diff options
author | Himbeer <himbeer@disroot.org> | 2024-09-26 22:26:56 +0200 |
---|---|---|
committer | Himbeer <himbeer@disroot.org> | 2024-09-26 22:26:56 +0200 |
commit | cc4cdce558e3204eb8320981ef04d90842128ab1 (patch) | |
tree | 02d6e57b8e04749fd630fab778b0684c4bf9842e | |
parent | 15ab6893227c4eec50539398bd8b65d1ff887cc0 (diff) |
Fix literal parsing accepting any non-booleans as strings
-rw-r--r-- | src/parse.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/parse.c b/src/parse.c index 87588e1..e906271 100644 --- a/src/parse.c +++ b/src/parse.c @@ -101,6 +101,7 @@ parse_string(struct lexer *lexer, char **out) *out = NULL; struct token s; + bool isstr = false; while (lex(lexer, &s) == T_STRING) { if (*out) { *out = strdup(s.info.str); @@ -108,10 +109,12 @@ parse_string(struct lexer *lexer, char **out) size_t sz = strlen(*out) + strlen(s.info.str) + 1; *out = must_realloc(*out, sz); } + + isstr = true; } unlex(lexer, &s); - return true; + return isstr; } static bool |