diff options
author | Anton Kling <anton@kling.gg> | 2024-10-11 16:43:15 +0200 |
---|---|---|
committer | Anton Kling <anton@kling.gg> | 2024-10-11 16:43:15 +0200 |
commit | 01281bfbf523a80edad7999bb471104e8f43e2da (patch) | |
tree | 61f6bd56245a16eada86ed2f85b374d5e9215307 /userland/minibox/utilities/sh/lexer.c | |
parent | f4a7c749b0f4bfa4c1007e64ca5f8ecb254bbfe1 (diff) |
sh: Add parsing of newlines
Diffstat (limited to 'userland/minibox/utilities/sh/lexer.c')
-rw-r--r-- | userland/minibox/utilities/sh/lexer.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/userland/minibox/utilities/sh/lexer.c b/userland/minibox/utilities/sh/lexer.c index 40e7211..d7f00c7 100644 --- a/userland/minibox/utilities/sh/lexer.c +++ b/userland/minibox/utilities/sh/lexer.c @@ -50,6 +50,7 @@ int parse_operand(struct sv *code_ptr, struct TOKEN *cur) { TRY_PARSE_STRING(">", TOKEN_STREAM); TRY_PARSE_STRING("|", TOKEN_PIPE); TRY_PARSE_STRING("&", TOKEN_BACKGROUND); + TRY_PARSE_STRING("\n", TOKEN_NEWLINE); // Failed to parse return 0; @@ -63,7 +64,7 @@ void skip_whitespace_and_comment(struct sv *s) { struct sv start; do { start = *s; - *s = sv_skip_chars(*s, " \t\n\r"); + *s = sv_skip_chars(*s, " \t\r"); if (!sv_partial_eq(*s, C_TO_SV("#"))) { return; } |