Files
42_INT_07_minishell/srcs/free.c
LuckyLaszlo ab2aa509df signals and termios WIP
+ shell script placeholder
+ generics functions
+ valgrind add_history() supp
+ misc
2021-10-30 16:39:24 +02:00

26 lines
1.2 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* free.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: lperrey <lperrey@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/10/10 23:53:17 by lperrey #+# #+# */
/* Updated: 2021/10/30 14:18:09 by lperrey ### ########.fr */
/* */
/* ************************************************************************** */
#include "minishell.h"
int free_exit(t_all *c, int exit_status)
{
free(c->prompt_base);
free(c->prompt);
ft_lstclear((t_list **)&c->token_list, free); // a voir avec Hugo, il y a un truc qui me semble superflu dans la fonction
ft_free_2d_arr(c->envp);
if (c->termios_changed)
tcsetattr(STDIN_FILENO, TCSANOW, &c->ori_termios);
rl_clear_history();
exit(exit_status);
}