This commit is contained in:
Loic Deridder
2025-02-18 10:01:55 +01:00
parent 84d6079a44
commit 00d2420d9f
7 changed files with 23 additions and 6 deletions

View File

@@ -28,6 +28,8 @@ static void add_prevhistory(t_msh *msh)
while (str)
{
tmp = ft_substr(str, 0, ft_strlen(str) - 1);
ft_free(&msh->prev_input);
msh->prev_input = ft_strdup(tmp);
add_history(tmp);
free(tmp);
free(str);
@@ -67,6 +69,7 @@ static void exit_manual(t_msh *msh)
}
else
ret = msh->ex_code;
ft_free(&msh->prev_input);
free_msh(msh);
ft_fprintf(2, "exit\n");
exit(ret);