fix historique

This commit is contained in:
Jack Halford 2017-03-13 14:29:23 +01:00
parent 4a46f6db57
commit bfb7c13e94
6 changed files with 9 additions and 7 deletions

View file

@ -6,7 +6,7 @@
/* By: wescande <wescande@student.42.fr> +#+ +:+ +#+ */ /* By: wescande <wescande@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2017/03/07 15:47:30 by wescande #+# #+# */ /* Created: 2017/03/07 15:47:30 by wescande #+# #+# */
/* Updated: 2017/03/13 14:13:02 by jhalford ### ########.fr */ /* Updated: 2017/03/13 14:21:27 by jhalford ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */

View file

@ -6,7 +6,7 @@
/* By: wescande <wescande@student.42.fr> +#+ +:+ +#+ */ /* By: wescande <wescande@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2017/03/07 17:20:53 by wescande #+# #+# */ /* Created: 2017/03/07 17:20:53 by wescande #+# #+# */
/* Updated: 2017/03/11 17:45:18 by jhalford ### ########.fr */ /* Updated: 2017/03/13 14:18:07 by jhalford ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */

View file

@ -6,7 +6,7 @@
/* By: ariard <ariard@student.42.fr> +#+ +:+ +#+ */ /* By: ariard <ariard@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2017/03/08 00:02:58 by ariard #+# #+# */ /* Created: 2017/03/08 00:02:58 by ariard #+# #+# */
/* Updated: 2017/03/13 14:13:24 by jhalford ### ########.fr */ /* Updated: 2017/03/13 14:20:56 by jhalford ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */

View file

@ -6,7 +6,7 @@
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */ /* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2017/03/05 14:54:45 by jhalford #+# #+# */ /* Created: 2017/03/05 14:54:45 by jhalford #+# #+# */
/* Updated: 2017/03/13 14:13:25 by jhalford ### ########.fr */ /* Updated: 2017/03/13 14:18:11 by jhalford ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */

View file

@ -6,7 +6,7 @@
/* By: gwojda <gwojda@student.42.fr> +#+ +:+ +#+ */ /* By: gwojda <gwojda@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2017/02/14 11:27:03 by gwojda #+# #+# */ /* Created: 2017/02/14 11:27:03 by gwojda #+# #+# */
/* Updated: 2017/03/10 12:59:26 by jhalford ### ########.fr */ /* Updated: 2017/03/13 14:23:03 by jhalford ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -21,6 +21,7 @@ void ft_add_in_history_file(char *str)
char **hist; char **hist;
i = 0; i = 0;
/* DG("gonna add [%s] in history"); */
hist = ft_strsplit(str, '\n'); hist = ft_strsplit(str, '\n');
if (!(home = ft_getenv(data_singleton()->env, "HOME"))) if (!(home = ft_getenv(data_singleton()->env, "HOME")))
return ; return ;

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 14:12:55 by jhalford ### ########.fr */ /* Updated: 2017/03/13 14:23:21 by jhalford ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -75,7 +75,8 @@ 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);
ft_add_str_in_history(lexer.str); if (SH_IS_INTERACTIVE(data_singleton()->opts))
ft_add_str_in_history(lexer.str);
return (0); return (0);
} }