From f8c6aed23d3d998b9b2f6201d981747c26d2087e Mon Sep 17 00:00:00 2001 From: Sergio Date: Thu, 23 Oct 2025 14:15:57 +0200 Subject: [PATCH] update: variables are now stored separeatedly in t_variables and lines are stored and parsed on each execution --- include/core.h | 28 +++++++++++++++++++++------- src/minishell.c | 14 +++++++++++--- 2 files changed, 32 insertions(+), 10 deletions(-) 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)); }