A lot of edit but adding the struct (Yes, i just use parameters of the function util now, See u morrow)
This commit is contained in:
parent
9c4dfafdf7
commit
56655f5426
15 changed files with 403 additions and 30 deletions
|
|
@ -6,15 +6,41 @@
|
|||
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/03/29 11:35:51 by rparodi #+# #+# */
|
||||
/* Updated: 2024/03/31 20:54:49 by rparodi ### ########.fr */
|
||||
/* Updated: 2024/04/01 01:16:47 by rparodi ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "../includes/minishell.h"
|
||||
|
||||
void ft_exit(t_str str, t_u8 exit_status)
|
||||
void ft_free_strs(t_str *strs)
|
||||
{
|
||||
free(str);
|
||||
t_usize i;
|
||||
|
||||
i = 0;
|
||||
while (strs[i])
|
||||
{
|
||||
free(strs[i]);
|
||||
i++;
|
||||
}
|
||||
free(strs);
|
||||
}
|
||||
|
||||
t_str str_input;
|
||||
t_str *strs_input;
|
||||
|
||||
void ft_free_utils(t_utils *s)
|
||||
{
|
||||
if (s->str_input)
|
||||
free(str_input);
|
||||
if (s->strs_input)
|
||||
ft_free_strs(strs_input);
|
||||
free(s);
|
||||
}
|
||||
|
||||
void ft_exit(t_utils *maiboyerlpb, t_u8 exit_status)
|
||||
{
|
||||
if (maiboyerlpb)
|
||||
ft_free_utils(maiboyerlpb);
|
||||
printf("exit\n");
|
||||
exit(exit_status);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue