fix: empty line is now not add to the history

This commit is contained in:
Camille Chauvet 2023-02-23 15:21:06 +01:00
parent 405c1937cd
commit 7728ded62d

1
main.c
View File

@ -31,6 +31,7 @@ static char *ft_get_user_input(t_list **env)
return (NULL); return (NULL);
} }
line = readline(prompt); line = readline(prompt);
if (line != NULL && ft_strcmp(line, "") != 0)
add_history(line); add_history(line);
free(prompt); free(prompt);
return (line); return (line);