From 8b9516b67272abbaa7b10bb93acbf64eb4eef42f Mon Sep 17 00:00:00 2001 From: gwojda Date: Fri, 17 Mar 2017 11:06:01 +0100 Subject: [PATCH] control C ajoutait des lignes vides a l'historique --- 42sh/src/history/add_str_in_history.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/42sh/src/history/add_str_in_history.c b/42sh/src/history/add_str_in_history.c index d770c59d..15c2cc38 100644 --- a/42sh/src/history/add_str_in_history.c +++ b/42sh/src/history/add_str_in_history.c @@ -6,7 +6,7 @@ /* By: gwojda +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/02/14 11:27:03 by gwojda #+# #+# */ -/* Updated: 2017/03/16 10:40:05 by gwojda ### ########.fr */ +/* Updated: 2017/03/17 11:05:33 by gwojda ### ########.fr */ /* */ /* ************************************************************************** */ @@ -41,7 +41,7 @@ void ft_add_in_history_file(char *str) void ft_add_str_in_history(char *str) { - if (str && (!data_singleton()->line.list_beg || + if (str && *str && (!data_singleton()->line.list_beg || ft_strcmp(data_singleton()->line.list_beg->prev->str, str))) { ft_push_back_history(&data_singleton()->line.list_beg,