From 3dc5aab22395ad305dd933226fef3aa553cb7970 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Mon, 20 Apr 2020 20:15:05 +0200 Subject: Wrong address --- src/ft_m_loop.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'src/ft_m_loop.c') diff --git a/src/ft_m_loop.c b/src/ft_m_loop.c index d993ac6..557a9b0 100644 --- a/src/ft_m_loop.c +++ b/src/ft_m_loop.c @@ -24,15 +24,25 @@ int32_t { int8_t gnl; char *line; + t_lcom *head; gnl = 1; while (gnl > 0) { ft_m_prompt(msh); gnl = get_next_line(STDIN_FILENO, &line); - ft_p_line(line, msh); - ft_memdel((void*)&line); - ft_e_lcom(msh->lcom_head, msh); + if (line[0] != '\0') + { + head = msh->lcom; + ft_p_line(line, msh); + ft_memdel((void*)&line); + ft_e_lcom(head, msh); + /* TODO: memdel lcom - INSTALL VALGRIND */ + } + else + { + ft_memdel((void*)&line); + } } return (FT_RET_FINE); } -- cgit v1.2.3