mmoat complete history

This commit is contained in:
lderidde
2025-02-08 20:29:32 +01:00
parent f09a9c70d3
commit 1e5e7a1bfc
3 changed files with 36 additions and 6 deletions

View File

@@ -11,6 +11,7 @@
/* ************************************************************************** */
#include "../includes/minishell.h"
#include <fcntl.h>
static char **ft_setnewenv(void)
{
@@ -31,6 +32,7 @@ t_msh *init_msh(char **envp)
t_msh *msh;
msh = malloc(sizeof(t_msh) * 1);
msh->hist = open(".mmoat_hisotry", O_RDWR | O_CREAT | O_APPEND, 0666);
msh->ex_code = 0;
msh->input = NULL;
if (!msh)
@@ -45,6 +47,7 @@ t_msh *init_msh(char **envp)
void free_msh(t_msh *msh)
{
free_tab(msh->env);
close(msh->hist);
free(msh->input);
free(msh);
}