From ead6757db67ab88b092cd7a064f9a835e6fb9478 Mon Sep 17 00:00:00 2001 From: Lukas Jiriste Date: Mon, 22 Jul 2024 22:55:40 +0200 Subject: [PATCH] Fix missing terminator null in assignment Instead there of terminating null there was a space left by the add_word function. That also caused wrong concatenation of chained var expansions --- src/execution.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/execution.c b/src/execution.c index fa928b7..8169c6b 100644 --- a/src/execution.c +++ b/src/execution.c @@ -6,7 +6,7 @@ /* By: ljiriste +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/07/21 08:57:54 by ljiriste #+# #+# */ -/* Updated: 2024/07/22 22:29:04 by ljiriste ### ########.fr */ +/* Updated: 2024/07/22 22:54:45 by ljiriste ### ########.fr */ /* */ /* ************************************************************************** */ @@ -65,6 +65,7 @@ int add_assignment(t_vec *assignments, const char *assignment, const t_execution return (1); if (add_word(&advanced_copy, assignment, env)) return (1); + *(char *)ft_vec_access(&advanced_copy, advanced_copy.size - 1) = '\0'; copy = advanced_copy.vec; unquote_field(copy); clear_old(assignments, copy); -- 2.30.2