This commit is contained in:
Jack Halford 2017-03-26 21:59:36 +02:00
parent e4824905f2
commit 2bb33fe50c
10 changed files with 15 additions and 17 deletions

View file

@ -6,7 +6,7 @@
/* By: jhalford <marvin@42.fr> +#+ +:+ +#+ */ /* By: jhalford <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2016/11/03 15:18:57 by jhalford #+# #+# */ /* Created: 2016/11/03 15:18:57 by jhalford #+# #+# */
/* Updated: 2017/03/26 21:33:45 by jhalford ### ########.fr */ /* Updated: 2017/03/26 21:56:50 by jhalford ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -14,7 +14,7 @@
void ft_lstdel(t_list **alst, void (*del)(void *, size_t)) void ft_lstdel(t_list **alst, void (*del)(void *, size_t))
{ {
if (!(alst || *alst || del)) if (!(alst && *alst && del))
return ; return ;
ft_lstdel(&(*alst)->next, del); ft_lstdel(&(*alst)->next, del);
ft_lstdelone(alst, del); ft_lstdelone(alst, del);

View file

@ -6,7 +6,7 @@
/* By: jhalford <jhalford@student.42.fr> +#+ +:+ +#+ */ /* By: jhalford <jhalford@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2017/03/08 14:31:42 by jhalford #+# #+# */ /* Created: 2017/03/08 14:31:42 by jhalford #+# #+# */
/* Updated: 2017/03/26 21:40:16 by jhalford ### ########.fr */ /* Updated: 2017/03/26 21:56:52 by jhalford ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -17,6 +17,8 @@ int exec_destroy(t_exec *exec)
t_jobc *jobc; t_jobc *jobc;
int i; int i;
if (!exec)
return (0);
jobc = &data_singleton()->jobc; jobc = &data_singleton()->jobc;
ft_lstdel(&exec->op_stack, ft_lst_cfree); ft_lstdel(&exec->op_stack, ft_lst_cfree);
ft_lstdel(&jobc->first_job, job_free); ft_lstdel(&jobc->first_job, job_free);

View file

@ -6,7 +6,7 @@
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */ /* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2017/03/26 21:28:09 by jhalford #+# #+# */ /* Created: 2017/03/26 21:28:09 by jhalford #+# #+# */
/* Updated: 2017/03/26 21:40:15 by jhalford ### ########.fr */ /* Updated: 2017/03/26 21:59:23 by jhalford ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */

View file

@ -6,7 +6,7 @@
/* By: jhalford <jhalford@student.42.fr> +#+ +:+ +#+ */ /* By: jhalford <jhalford@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2017/03/13 22:21:19 by jhalford #+# #+# */ /* Created: 2017/03/13 22:21:19 by jhalford #+# #+# */
/* Updated: 2017/03/26 21:39:39 by jhalford ### ########.fr */ /* Updated: 2017/03/26 21:50:39 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/25 20:26:01 by jhalford ### ########.fr */ /* Updated: 2017/03/26 21:59:21 by jhalford ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */

View file

@ -6,7 +6,7 @@
/* By: jhalford <jhalford@student.42.fr> +#+ +:+ +#+ */ /* By: jhalford <jhalford@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2016/12/07 18:07:50 by jhalford #+# #+# */ /* Created: 2016/12/07 18:07:50 by jhalford #+# #+# */
/* Updated: 2017/03/26 21:40:48 by jhalford ### ########.fr */ /* Updated: 2017/03/26 21:59:25 by jhalford ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -17,9 +17,8 @@ void data_exit(void)
t_data *data; t_data *data;
data = data_singleton(); data = data_singleton();
ft_strdel(&data->line.input); /* ft_strdel(&data->line.input); */
ft_strdel(&data->binary); ft_strdel(&data->binary);
exec_popfds();
ft_sstrfree(data->env); ft_sstrfree(data->env);
ft_sstrfree(data->local_var); ft_sstrfree(data->local_var);
ft_sstrfree(data->argv); ft_sstrfree(data->argv);

View file

@ -6,7 +6,7 @@
/* By: jhalford <jhalford@student.42.fr> +#+ +:+ +#+ */ /* By: jhalford <jhalford@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2016/11/28 19:26:32 by jhalford #+# #+# */ /* Created: 2016/11/28 19:26:32 by jhalford #+# #+# */
/* Updated: 2017/03/26 21:40:49 by jhalford ### ########.fr */ /* Updated: 2017/03/26 21:54:19 by jhalford ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -83,9 +83,9 @@ int data_init(int ac, char **av, char **env)
data->comp = NULL; data->comp = NULL;
data->opts = SH_INTERACTIVE | SH_OPTS_JOBC; data->opts = SH_INTERACTIVE | SH_OPTS_JOBC;
data->lst_func = NULL; data->lst_func = NULL;
exec_init(&data->exec);
lexer_init(&data->lexer); lexer_init(&data->lexer);
parser_init(&data->parser); parser_init(&data->parser);
exec_init(&data->exec);
if ((term_name = ft_getenv(data->env, "TERM")) == NULL) if ((term_name = ft_getenv(data->env, "TERM")) == NULL)
term_name = "dumb"; term_name = "dumb";
if (tgetent(NULL, term_name) != 1) if (tgetent(NULL, term_name) != 1)

View file

@ -6,7 +6,7 @@
/* By: gwojda <gwojda@student.42.fr> +#+ +:+ +#+ */ /* By: gwojda <gwojda@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2017/03/20 14:45:40 by gwojda #+# #+# */ /* Created: 2017/03/20 14:45:40 by gwojda #+# #+# */
/* Updated: 2017/03/26 21:37:49 by jhalford ### ########.fr */ /* Updated: 2017/03/26 21:57:37 by jhalford ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -80,7 +80,6 @@ int main(int ac, char **av, char **env)
lexer_destroy(&data->lexer); lexer_destroy(&data->lexer);
parser_destroy(&data->parser); parser_destroy(&data->parser);
exec_destroy(&data->exec); exec_destroy(&data->exec);
/* ft_lstdel(&data_singleton()->exec.op_stack, &ft_lst_cfree); */
ft_lstdel(&token, &token_free); ft_lstdel(&token, &token_free);
btree_del(&ast, &ast_free); btree_del(&ast, &ast_free);
if (ret == 1) if (ret == 1)

View file

@ -6,7 +6,7 @@
/* By: ariard <ariard@student.42.fr> +#+ +:+ +#+ */ /* By: ariard <ariard@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2017/03/16 19:30:17 by ariard #+# #+# */ /* Created: 2017/03/16 19:30:17 by ariard #+# #+# */
/* Updated: 2017/03/18 18:45:22 by ariard ### ########.fr */ /* Updated: 2017/03/26 21:46:24 by jhalford ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */

View file

@ -6,7 +6,7 @@
/* By: ariard <ariard@student.42.fr> +#+ +:+ +#+ */ /* By: ariard <ariard@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2017/03/16 20:31:32 by ariard #+# #+# */ /* Created: 2017/03/16 20:31:32 by ariard #+# #+# */
/* Updated: 2017/03/26 21:37:19 by jhalford ### ########.fr */ /* Updated: 2017/03/26 21:47:01 by jhalford ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -14,8 +14,6 @@
int stack_init(t_parser *parser) int stack_init(t_parser *parser)
{ {
ft_lstdel(&parser->stack, ft_lst_cfree);
/* parser->stack = NULL; */
push_stack(&parser->stack, TERMINUS); push_stack(&parser->stack, TERMINUS);
push_stack(&parser->stack, LINEBREAK); push_stack(&parser->stack, LINEBREAK);
if (!parser->new_sym && !(parser->new_sym = ft_memalloc(sizeof(t_sym)))) if (!parser->new_sym && !(parser->new_sym = ft_memalloc(sizeof(t_sym))))