heredoc ok

This commit is contained in:
Antoine Riard 2017-03-18 19:00:46 +01:00
parent 3a58fcd715
commit 6f58bb20b3
5 changed files with 11 additions and 19 deletions

View file

@ -6,7 +6,7 @@
/* By: jhalford <jhalford@student.42.fr> +#+ +:+ +#+ */ /* By: jhalford <jhalford@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2016/11/10 13:07:44 by jhalford #+# #+# */ /* Created: 2016/11/10 13:07:44 by jhalford #+# #+# */
/* Updated: 2017/03/17 23:20:13 by ariard ### ########.fr */ /* Updated: 2017/03/18 18:42:58 by ariard ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -51,7 +51,6 @@ struct s_data
t_comp *comp; t_comp *comp;
t_exec exec; t_exec exec;
t_jobc jobc; t_jobc jobc;
t_list *heredoc_queue;
char **local_var; char **local_var;
t_list *lst_func; t_list *lst_func;
}; };

View file

@ -6,20 +6,12 @@
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */ /* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2016/12/05 11:50:51 by jhalford #+# #+# */ /* Created: 2016/12/05 11:50:51 by jhalford #+# #+# */
/* Updated: 2017/03/18 17:34:46 by ariard ### ########.fr */ /* Updated: 2017/03/18 18:17:20 by ariard ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
#include "minishell.h" #include "minishell.h"
void read_redir(void *data)
{
t_redir *redir;
redir = data;
DG("file : [%s]", redir->word);
}
void ast_free(void *data, size_t content_size) void ast_free(void *data, size_t content_size)
{ {
t_astnode *node; t_astnode *node;

View file

@ -6,7 +6,7 @@
/* By: ariard <ariard@student.42.fr> +#+ +:+ +#+ */ /* By: ariard <ariard@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2017/03/03 18:12:57 by ariard #+# #+# */ /* Created: 2017/03/03 18:12:57 by ariard #+# #+# */
/* Updated: 2017/03/18 17:27:56 by ariard ### ########.fr */ /* Updated: 2017/03/18 18:59:57 by ariard ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -18,9 +18,10 @@ void redir_free(void *data, size_t content_size)
(void)content_size; (void)content_size;
redir = data; redir = data;
if (redir->type == TK_GREAT || redir->type == TK_LESS || redir->type == TK_DGREAT)
{
ft_strdel(&redir->word); ft_strdel(&redir->word);
} if (redir->type == TK_DLESS)
ft_strdel(&redir->heredoc_data);
redir->type = 0;
redir->n = 0;
free(redir); free(redir);
} }

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/17 18:42:58 by ariard ### ########.fr */ /* Updated: 2017/03/18 19:00:17 by ariard ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */

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/17 17:55:38 by ariard ### ########.fr */ /* Updated: 2017/03/18 18:45:22 by ariard ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -16,7 +16,7 @@ void parser_destroy(t_parser *parser)
{ {
parser->state = SUCCESS; parser->state = SUCCESS;
ft_lstdel(&parser->stack, &ft_lst_cfree); ft_lstdel(&parser->stack, &ft_lst_cfree);
ft_lstdel(&data_singleton()->parser.heredoc_queue, &ft_lst_cfree); ft_lstdel(&parser->heredoc_queue, &ft_lst_cfree);
free(parser->new_sym); free(parser->new_sym);
parser->new_sym = NULL; parser->new_sym = NULL;
} }