From 7728ded62d2f9acd4e3c7b6bdb79ba3c7e01c3a5 Mon Sep 17 00:00:00 2001 From: Camille Chauvet Date: Thu, 23 Feb 2023 15:21:06 +0100 Subject: [PATCH] fix: empty line is now not add to the history --- main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.c b/main.c index e3e9e4d..5a54f8a 100644 --- a/main.c +++ b/main.c @@ -31,7 +31,8 @@ static char *ft_get_user_input(t_list **env) return (NULL); } line = readline(prompt); - add_history(line); + if (line != NULL && ft_strcmp(line, "") != 0) + add_history(line); free(prompt); return (line); }