clear history on shell end

This commit is contained in:
Quinten Mennen 2025-02-25 21:00:40 +01:00
parent aba5e2f28b
commit f67c5a0f21
2 changed files with 9 additions and 7 deletions

View File

@ -1,12 +1,12 @@
/* ************************************************************************** */ /* ************************************************************************** */
/* */ /* */
/* :::::::: */ /* ::: :::::::: */
/* builtin_exit.c :+: :+: */ /* builtin_exit.c :+: :+: :+: */
/* +:+ */ /* +:+ +:+ +:+ */
/* By: whaffman <whaffman@student.codam.nl> +#+ */ /* By: qmennen <qmennen@student.codam.nl> +#+ +:+ +#+ */
/* +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2025/02/20 11:32:59 by whaffman #+# #+# */ /* Created: 2025/02/20 11:32:59 by whaffman #+# #+# */
/* Updated: 2025/02/25 16:04:17 by whaffman ######## odam.nl */ /* Updated: 2025/02/25 20:56:29 by qmennen ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -38,6 +38,7 @@ int builtin_exit(t_minishell *minishell, t_command *cmd)
} }
//print_freelist(minishell); //print_freelist(minishell);
free_minishell(&minishell); free_minishell(&minishell);
rl_clear_history();
exit(exit_status); exit(exit_status);
return (FAILURE); return (FAILURE);
} }

View File

@ -39,5 +39,6 @@ int main(int argc, char **argv, char **envp)
} }
ft_lstclear_safe(minishell, &minishell->commands, free_command_list); ft_lstclear_safe(minishell, &minishell->commands, free_command_list);
free_minishell(&minishell); free_minishell(&minishell);
rl_clear_history();
return (EXIT_SUCCESS); return (EXIT_SUCCESS);
} }