summaryrefslogtreecommitdiffstats
path: root/src/ft_m_loop.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ft_m_loop.c')
-rw-r--r--src/ft_m_loop.c16
1 files changed, 13 insertions, 3 deletions
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);
}