From: Lukas Jiriste Date: Mon, 22 Jul 2024 20:55:40 +0000 (+0200) Subject: Fix missing terminator null in assignment X-Git-Url: https://git.ljiriste.work/?a=commitdiff_plain;h=ead6757db67ab88b092cd7a064f9a835e6fb9478;p=42%2Fminishell.git 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 --- 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);