From f01a770b2980f706fd4c6bc576d007e10cd743c8 Mon Sep 17 00:00:00 2001 From: Jack Halford Date: Mon, 13 Mar 2017 16:42:56 +0100 Subject: [PATCH] pas d'ajout a l'historique pour les lignes vides --- 42sh/src/exec/redirect_dless.c | 2 -- 42sh/src/main/main.c | 4 ++-- 42sh/src/parser/heredoc_parser.c | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/42sh/src/exec/redirect_dless.c b/42sh/src/exec/redirect_dless.c index 60cb85c2..15c16342 100644 --- a/42sh/src/exec/redirect_dless.c +++ b/42sh/src/exec/redirect_dless.c @@ -18,8 +18,6 @@ int redirect_dless(t_redir *redir) pipe(fds); str = redir->heredoc_data; - DG("[%s] && adr %p", str, str); - DG("redir @ %p", redir); write(fds[PIPE_WRITE], str, ft_strlen(str)); close(fds[PIPE_WRITE]); dup2(fds[PIPE_READ], redir->n); diff --git a/42sh/src/main/main.c b/42sh/src/main/main.c index 1b0dbf1d..df085593 100644 --- a/42sh/src/main/main.c +++ b/42sh/src/main/main.c @@ -6,7 +6,7 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/12/06 18:40:58 by jhalford #+# #+# */ -/* Updated: 2017/03/13 16:12:40 by jhalford ### ########.fr */ +/* Updated: 2017/03/13 16:42:00 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */ @@ -77,7 +77,7 @@ int handle_instruction(int fd) if (ft_exec(&ast)) return (1); instruction_free(&token, &parser, &ast); - if (SH_IS_INTERACTIVE(data_singleton()->opts)) + if (SH_IS_INTERACTIVE(data_singleton()->opts) && *lexer.str) ft_add_str_in_history(lexer.str); return (0); } diff --git a/42sh/src/parser/heredoc_parser.c b/42sh/src/parser/heredoc_parser.c index 774ee758..12fc67b0 100644 --- a/42sh/src/parser/heredoc_parser.c +++ b/42sh/src/parser/heredoc_parser.c @@ -6,7 +6,7 @@ /* By: ariard +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/03/08 16:21:05 by ariard #+# #+# */ -/* Updated: 2017/03/13 16:12:23 by jhalford ### ########.fr */ +/* Updated: 2017/03/13 16:40:27 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */