From 386c44e541af7aa1ba594d2f0a9665199b3dffb4 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Mon, 20 Apr 2020 17:04:59 +0200 Subject: Nice prompt --- src/minishell.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/minishell.c') diff --git a/src/minishell.c b/src/minishell.c index 5d97ed6..a3b0354 100644 --- a/src/minishell.c +++ b/src/minishell.c @@ -11,9 +11,10 @@ /* ************************************************************************** */ #include +#include #include "minishell.h" #include "ft_d_enum.h" -#include "ft_m_prompt.h" +#include "ft_m_loop.h" #include "ft_s_struct.h" #include "ft_s_init.h" #include "ft_s_destroy.h" @@ -24,23 +25,23 @@ main(int argc, char *envp[]) { t_msh *msh; + int32_t ret; (void)argc; (void)argv; - (void)envp; - if (!(msh = ft_init_msh())) + if (!(msh = ft_init_msh(envp))) { return (FT_RET_ALLOC); } - msh->envp = envp; - ft_m_prompt(msh); + msh->ret = ft_m_loop(msh); + ret = msh->ret; /* while (*msh->envp) */ /* { */ /* ft_printf("%s\n", *msh->envp); */ /* msh->envp++; */ /* } */ ft_s_destroy(msh); - return (FT_RET_FINE); + return (ret); } /* -- cgit v1.2.3