From ac4965ca6d5552c609b06f624b3403e3db186f1c Mon Sep 17 00:00:00 2001 From: Sergio Date: Wed, 11 Feb 2026 10:12:20 +0100 Subject: [PATCH] fix: fixed multiple syntax error logging when redirection value is not a word pointer is moved to the last position to avoid double logging --- src/parser/parser.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/parser/parser.c b/src/parser/parser.c index 993a011..81a3082 100644 --- a/src/parser/parser.c +++ b/src/parser/parser.c @@ -6,7 +6,7 @@ /* By: sede-san type != TOKEN_WORD) { free(redirection); + while (*tokens != NULL) + *tokens = (*tokens)->next; return (syntax_error_unexpected_token(token), NULL); } redirection->target = ft_strdup(token->value);