From 3dd5f12ee5fae5bc4e97863b4923d881de60d550 Mon Sep 17 00:00:00 2001 From: Max Wash Date: Tue, 12 May 2026 22:48:08 +0100 Subject: [PATCH] parse: lex: fix string state not terminating when encountering a dquote --- bshell/parse/lex/string.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/bshell/parse/lex/string.c b/bshell/parse/lex/string.c index fac7b81..bb7d230 100644 --- a/bshell/parse/lex/string.c +++ b/bshell/parse/lex/string.c @@ -14,13 +14,10 @@ static enum bshell_status string_symbol(struct lex_ctx *ctx) struct lex_token *tok = NULL; switch (sym->id) { - case SYM_DOLLAR_LEFT_PAREN: - status = push_symbol(ctx, sym->id); - if (status != BSHELL_SUCCESS) { - return status; - } - + case SYM_DQUOTE: return BSHELL_SUCCESS; + case SYM_DOLLAR_LEFT_PAREN: + return push_symbol(ctx, sym->id); case SYM_DOLLAR: status = read_var(ctx, TOK_VAR, &tok); if (status != BSHELL_SUCCESS) { @@ -130,6 +127,7 @@ static const unsigned int symbols[] = { SYM_DOLLAR, SYM_DOLLAR_LEFT_PAREN, SYM_DOLLAR_LEFT_BRACE, + SYM_DQUOTE, SYM_NONE, }; @@ -139,4 +137,5 @@ const struct lex_state_type lex_string_state = { .s_end = string_end, .s_pump_token = string_pump_token, .s_links = links, + .s_symbols = symbols, };