From: Lukáš Jiřiště Date: Tue, 27 Aug 2024 13:31:10 +0000 (+0200) Subject: Fix variable assignment broken by 7d83204 X-Git-Url: https://git.ljiriste.work/?a=commitdiff_plain;h=f8778f1662ed64181ff94b6b9abcea332a8d6006;p=42%2Fminishell.git Fix variable assignment broken by 7d83204 Also free assignments with free_str isntead of free. --- diff --git a/src/execution.c b/src/execution.c index a60991e..ab8e4da 100644 --- a/src/execution.c +++ b/src/execution.c @@ -6,7 +6,7 @@ /* By: lnikolov size) { - var_line = ft_vec_caccess(assignments, i); + var_line = *(char **)ft_vec_caccess(assignments, i); var_name = get_var_name(var_line); if (!var_name) return (1); @@ -875,13 +875,13 @@ int ex_simple_command(t_parse_tree_node *simple_command, t_execution_env *env) { assignments_to_env(&assignments, env); ft_vec_free(&redirections, close_redirection); - ft_vec_free(&assignments, NULL); + ft_vec_free(&assignments, free_str); free_split(fields); return (0); } res = ex_fields(fields, &assignments, &redirections, env); ft_vec_free(&redirections, close_redirection); - ft_vec_free(&assignments, free); + ft_vec_free(&assignments, free_str); free_split(fields); return (res); }