From b26125c7c9163410bd11193909f04106f0582dc9 Mon Sep 17 00:00:00 2001 From: Anton Kling Date: Sun, 15 Dec 2024 03:24:29 +0100 Subject: sh: Partially working strings using "" --- userland/minibox/utilities/sh/lexer.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/userland/minibox/utilities/sh/lexer.c b/userland/minibox/utilities/sh/lexer.c index 52126b4..8e404a3 100644 --- a/userland/minibox/utilities/sh/lexer.c +++ b/userland/minibox/utilities/sh/lexer.c @@ -29,6 +29,15 @@ int is_special_char(char c) { int parse_chars(struct sv *code_ptr, struct TOKEN *cur) { struct sv code = *code_ptr; + + if (sv_partial_eq(code, C_TO_SV("\""))) { + sv_take(code, &code, 1); + cur->type = TOKEN_CHARS; + cur->string_rep = sv_split_delim(code, &code, '"'); + *code_ptr = code; + return 1; + } + if (is_special_char(sv_peek(code))) { return 0; } -- cgit v1.2.3