diff --git a/include/core.h b/include/core.h index 72dad98..8225dde 100644 --- a/include/core.h +++ b/include/core.h @@ -6,7 +6,7 @@ /* By: sede-san env = envp; + minishell->variables.environment = envp; return (1); } @@ -29,9 +29,16 @@ u_int8_t minishell_run( while (1) { line = readline("minishell > "); + if (!*line) + { + free(line); + continue ; + } + add_history(line); + parse(line, minishell); if (!ft_strcmp(line, "exit")) break ; - printf("%s\n", line); + // printf("%s\n", line); free(line); } free(line); @@ -41,5 +48,6 @@ u_int8_t minishell_run( void minishell_clear( t_minishell *minishell ){ + rl_clear_history(); ft_bzero(minishell, sizeof(t_minishell)); }