fix valgrind
This commit is contained in:
parent
8cfd839045
commit
92759513e8
1 changed files with 5 additions and 6 deletions
11
src/main.c
11
src/main.c
|
@ -6,7 +6,7 @@
|
|||
/* By: jschaft <cecile.schaft@orange.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/04/23 14:33:45 by mcolonna #+# #+# */
|
||||
/* Updated: 2024/06/20 18:17:03 by mcolonna ### ########.fr */
|
||||
/* Updated: 2024/06/21 14:44:16 by mcolonna ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -49,7 +49,6 @@ static int do_command(t_env *env, const char *str)
|
|||
static void start(t_env *env)
|
||||
{
|
||||
env->mc_command = mem_subclass(fatal_error, env->mc_global);
|
||||
do_command(env, "clear");
|
||||
do_command(env, "cat ./header");
|
||||
do_command(env, "echo");
|
||||
mem_freeall(env->mc_command);
|
||||
|
@ -63,12 +62,12 @@ static void prompt_command(t_env *env)
|
|||
env->mc_command = mem_subclass(fatal_error, env->mc_global);
|
||||
command_str = ask_command(env);
|
||||
if (!command_str)
|
||||
{
|
||||
env->exit = true;
|
||||
exit(0);
|
||||
else
|
||||
{
|
||||
add_history(command_str);
|
||||
do_command(env, command_str);
|
||||
}
|
||||
add_history(command_str);
|
||||
do_command(env, command_str);
|
||||
mem_freeall(env->mc_command);
|
||||
env->mc_command = NULL;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue