From 79405df39d8d1606677238da8ffebde4930894fc Mon Sep 17 00:00:00 2001 From: mcolonna Date: Tue, 25 Jun 2024 15:41:44 +0200 Subject: [PATCH] fix: unclosed " --- dev/TODO | 1 - src/parse_command.c | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/dev/TODO b/dev/TODO index 259fbd6..6b5cb89 100644 --- a/dev/TODO +++ b/dev/TODO @@ -11,7 +11,6 @@ - fix - empty variables aren't freed - the builtins should get all arguments and check if they're good - - command `echo "hello` with unclosed quotes (unnecessary part) - working history (rl_* functions?) diff --git a/src/parse_command.c b/src/parse_command.c index eb49b3c..8e544bf 100644 --- a/src/parse_command.c +++ b/src/parse_command.c @@ -6,7 +6,7 @@ /* By: mcolonna +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/04/24 13:47:40 by mcolonna #+# #+# */ -/* Updated: 2024/06/25 15:28:41 by mcolonna ### ########.fr */ +/* Updated: 2024/06/25 15:39:55 by mcolonna ### ########.fr */ /* */ /* ************************************************************************** */ @@ -229,7 +229,7 @@ static bool read_string_doublequote(t_parsing_args *args, const char **dest) if (stream_read(&args->stream) != '"') return (false); stream_pop(&args->stream); - while (stream_read(&args->stream) != '"') + while (stream_read(&args->stream) && stream_read(&args->stream) != '"') { read_until(args, dest, "\"$"); if (stream_read(&args->stream) == '$')