Corrected the exec part
This commit is contained in:
parent
b387c00e43
commit
e1659508c6
6 changed files with 128 additions and 35 deletions
|
|
@ -6,12 +6,19 @@
|
|||
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/03/29 11:35:51 by rparodi #+# #+# */
|
||||
/* Updated: 2024/04/01 18:21:22 by rparodi ### ########.fr */
|
||||
/* Updated: 2024/04/13 20:15:37 by rparodi ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "../includes/minishell.h"
|
||||
|
||||
void ft_free(void *ptr)
|
||||
{
|
||||
if (!ptr)
|
||||
free(ptr);
|
||||
ptr = NULL;
|
||||
}
|
||||
|
||||
void ft_free_strs(t_str *strs)
|
||||
{
|
||||
t_usize i;
|
||||
|
|
@ -19,18 +26,18 @@ void ft_free_strs(t_str *strs)
|
|||
i = 0;
|
||||
while (strs[i])
|
||||
{
|
||||
free(strs[i]);
|
||||
ft_free(strs[i]);
|
||||
i++;
|
||||
}
|
||||
free(strs);
|
||||
ft_free(strs);
|
||||
}
|
||||
|
||||
void ft_free_utils(t_utils *s)
|
||||
{
|
||||
if (s->name_shell)
|
||||
free(s->name_shell);
|
||||
ft_free(s->name_shell);
|
||||
if (s->str_input)
|
||||
free(s->str_input);
|
||||
ft_free(s->str_input);
|
||||
if (s->strs_input)
|
||||
ft_free_strs(s->strs_input);
|
||||
if (s->path)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue