From: Lukáš Jiřiště Date: Mon, 26 Aug 2024 10:08:16 +0000 (+0200) Subject: Fix tokenization bug introduced in aac1d76 X-Git-Url: https://git.ljiriste.work/?a=commitdiff_plain;h=75a808eb49fd78d33e21ea23d16f994b7c976f30;p=42%2Fminishell.git Fix tokenization bug introduced in aac1d76 In commit aac1d76 the tokenization was changed to set ASSIGNMENT_WORDs to WORDs when the ASSIGNMENT_WORD is not in a proper place. The filter however didn't check whether current token is ASSIGNMENT_WORD hence other tokens could be changed to WORD also. --- diff --git a/src/tokenization.c b/src/tokenization.c index 2c38392..679dbd5 100644 --- a/src/tokenization.c +++ b/src/tokenization.c @@ -6,7 +6,7 @@ /* By: ljiriste +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/06/21 16:34:43 by ljiriste #+# #+# */ -/* Updated: 2024/08/23 18:43:53 by ljiriste ### ########.fr */ +/* Updated: 2024/08/26 12:07:29 by ljiriste ### ########.fr */ /* */ /* ************************************************************************** */ @@ -235,7 +235,7 @@ void filter_assignment_word(t_vec *tokens) while (i < tokens->size) { token = ft_vec_access(tokens, i); - if (i == 0) + if (i == 0 || token->type != g_tokens[ASSIGNMENT_WORD]) { ++i; continue ;