pas d'ajout a l'historique pour les lignes vides

This commit is contained in:
Jack Halford 2017-03-13 16:42:56 +01:00
parent f5c35a73d8
commit f01a770b29
3 changed files with 3 additions and 5 deletions

View file

@ -18,8 +18,6 @@ int redirect_dless(t_redir *redir)
pipe(fds); pipe(fds);
str = redir->heredoc_data; str = redir->heredoc_data;
DG("[%s] && adr %p", str, str);
DG("redir @ %p", redir);
write(fds[PIPE_WRITE], str, ft_strlen(str)); write(fds[PIPE_WRITE], str, ft_strlen(str));
close(fds[PIPE_WRITE]); close(fds[PIPE_WRITE]);
dup2(fds[PIPE_READ], redir->n); dup2(fds[PIPE_READ], redir->n);

View file

@ -6,7 +6,7 @@
/* By: jhalford <jhalford@student.42.fr> +#+ +:+ +#+ */ /* By: jhalford <jhalford@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2016/12/06 18:40:58 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)) if (ft_exec(&ast))
return (1); return (1);
instruction_free(&token, &parser, &ast); 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); ft_add_str_in_history(lexer.str);
return (0); return (0);
} }

View file

@ -6,7 +6,7 @@
/* By: ariard <ariard@student.42.fr> +#+ +:+ +#+ */ /* By: ariard <ariard@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2017/03/08 16:21:05 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 */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */