less leaks but stll somes

This commit is contained in:
Antoine Riard 2017-03-21 21:19:56 +01:00
parent 00cba8ea4d
commit ad2855cebb
18 changed files with 366 additions and 29 deletions

View file

@ -87,6 +87,7 @@ exec/mark_process_status.c\
exec/node_copy.c\
exec/pfree_cmd.c\
exec/pfree_cond.c\
exec/pfree_func.c\
exec/pfree_list.c\
exec/pfree_subshell.c\
exec/plaunch_brace.c\

View file

@ -6,7 +6,7 @@
/* By: jhalford <jhalford@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/11/27 20:29:56 by jhalford #+# #+# */
/* Updated: 2017/03/21 00:45:28 by wescande ### ########.fr */
/* Updated: 2017/03/21 20:17:27 by ariard ### ########.fr */
/* */
/* ************************************************************************** */
@ -179,6 +179,7 @@ int pfree_cmd(t_process *p);
int pfree_cond(t_process *p);
int pfree_list(t_process *p);
int pfree_subshell(t_process *p);
int pfree_func(t_process *p);
/*
** Mapping pour launch les process

View file

@ -82,7 +82,6 @@ int error_eof(void);
int ft_read_stack(t_sym *stack);
char *read_state(t_sym current);
/*
* Build AST - rewriting
*
@ -152,9 +151,6 @@ struct s_distrostree
int (*add)(t_btree **ast, t_list **lst);
};
/* extern t_distrostree g_distrostree[]; */
/* extern t_treematch g_treematch[]; */
struct s_redir
{
t_type type;

View file

@ -6,7 +6,7 @@
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/12/05 11:43:03 by jhalford #+# #+# */
/* Updated: 2017/03/21 19:10:56 by ariard ### ########.fr */
/* Updated: 2017/03/21 19:43:51 by ariard ### ########.fr */
/* */
/* ************************************************************************** */
@ -16,7 +16,6 @@ void btree_del(t_btree **root, void (*del)(void *, size_t))
{
if (root && *root && del)
{
DG();
btree_del(&(*root)->left, del);
btree_del(&(*root)->right, del);
btree_delone(root, del);

313
42sh/log Normal file
View file

@ -0,0 +1,313 @@
Norme: ./src/builtin/bt_read_get.c
Norme: ./src/builtin/builtin_echo.c
Norme: ./src/builtin/bt_read_term.c
Norme: ./src/builtin/builtin_exit.c
Norme: ./src/builtin/builtin_hash.c
Norme: ./src/builtin/builtin_history.c
Norme: ./src/builtin/builtin_export.c
Norme: ./src/builtin/builtin_cd.c
Norme: ./src/builtin/builtin_return_status.c
Norme: ./src/builtin/builtin_env.c
Error (line 61): function env_treat_flag has 32 lines
Norme: ./src/builtin/builtin_unset.c
Norme: ./src/builtin/builtin_unsetenv.c
Norme: ./src/builtin/builtin_setenv.c
Error (line 15): wrong number of spaces in preprocessor line
Norme: ./src/builtin/error_msg.c
Norme: ./src/builtin/is_builtin.c
Norme: ./src/builtin/builtin_read.c
Norme: ./src/completion/c_arrow.c
Norme: ./src/builtin/builtin_math.c
Norme: ./src/completion/c_find_abspath.c
Norme: ./src/completion/c_find_binary.c
Norme: ./src/completion/c_find_env.c
Norme: ./src/completion/c_clear.c
Norme: ./src/completion/c_match.c
Norme: ./src/completion/c_init.c
Norme: ./src/completion/c_find_files.c
Norme: ./src/completion/c_misc.c
Norme: ./src/completion/c_match_glob.c
Error (line 19): function c_replace_globbing has 27 lines
Norme: ./src/completion/c_match_update.c
Norme: ./src/completion/c_parser.c
Norme: ./src/completion/c_output.c
Norme: ./src/completion/c_sizing.c
Norme: ./src/completion/c_terminal.c
Norme: ./src/completion/c_printer.c
Norme: ./src/exec/bad_fd.c
Norme: ./src/completion/completion.c
Norme: ./src/exec/error_badidentifier.c
Norme: ./src/exec/ast_free.c
Norme: ./src/exec/exec_ampersand.c
Norme: ./src/exec/exec_and_if.c
Norme: ./src/exec/exec_bang.c
Norme: ./src/exec/exec_else.c
Norme: ./src/exec/exec_elif.c
Norme: ./src/exec/exec_case_branch.c
Norme: ./src/exec/exec_pipe.c
Norme: ./src/exec/exec_or_if.c
Norme: ./src/exec/exec_semi.c
Norme: ./src/exec/exec_var.c
Norme: ./src/exec/exec_reset.c
Norme: ./src/exec/fd_is_valid.c
Norme: ./src/completion/c_pathsolver.c
Norme: ./src/exec/exec_leaf.c
Error (line 55): bad indentation
Norme: ./src/exec/mark_process_status.c
Norme: ./src/exec/is_function.c
Error (line 31, col 3): missing space after break
Norme: ./src/exec/ft_findexec.c
Norme: ./src/exec/pfree_cmd.c
Norme: ./src/exec/pfree_func.c
Norme: ./src/exec/pfree_cond.c
Norme: ./src/exec/ft_exec.c
Norme: ./src/exec/pfree_subshell.c
Norme: ./src/exec/node_copy.c
Norme: ./src/exec/pfree_list.c
Norme: ./src/exec/plaunch_brace.c
Norme: ./src/exec/plaunch_empty.c
Norme: ./src/exec/plaunch_builtin.c
Norme: ./src/exec/plaunch_case.c
Norme: ./src/exec/plaunch_if.c
Error (line 19): comment not well formatted
Error (line 19): comment not well placed
Norme: ./src/exec/plaunch_subshell.c
Norme: ./src/exec/plaunch_function.c
Error (line 15): spaces at the end of line
Error (line 29): spaces at the end of line
Error (line 29, col 19): bad character after ;
Norme: ./src/exec/plaunch_for.c
Norme: ./src/exec/plaunch_while.c
Norme: ./src/exec/plaunch_file.c
Norme: ./src/exec/plaunch_until.c
Norme: ./src/exec/process_resetfds.c
Error (line 25): comment not well formatted
Error (line 25): bad indentation
Error (line 25): line has 146 characters
Error (line 25): comment not well placed
Error (line 26): comment not well formatted
Error (line 26): bad indentation
Error (line 26): comment not well placed
Error (line 27): bad indentation
Error (line 28): comment not well formatted
Error (line 28): comment not well placed
Error (line 29): comment not well formatted
Error (line 29): comment not well placed
Error (line 30): comment not well formatted
Error (line 30): comment not well placed
Norme: ./src/exec/process_setgroup.c
Norme: ./src/exec/process_launch.c
Error (line 49): comment not well formatted
Error (line 49): comment not well placed
Error (line 50): comment not well formatted
Error (line 50): comment not well placed
Error (line 67): bad indentation
Norme: ./src/exec/process_setsig.c
Norme: ./src/exec/pset_brace.c
Norme: ./src/exec/process_redirect.c
Norme: ./src/exec/pset_case.c
Norme: ./src/exec/pset_for.c
Norme: ./src/exec/pset_if.c
Norme: ./src/exec/pset_subshell.c
Norme: ./src/exec/pset_until.c
Norme: ./src/exec/process_set.c
Error (line 47): function process_set has 26 lines
Norme: ./src/exec/pset_while.c
Norme: ./src/exec/redir_free.c
Norme: ./src/exec/pset_cmd.c
Norme: ./src/exec/redirect_dgreat.c
Norme: ./src/exec/redir_copy.c
Norme: ./src/exec/redirect_great.c
Norme: ./src/exec/redirect_dless.c
Norme: ./src/exec/redirect_less.c
Norme: ./src/exec/redirect_greatand.c
Norme: ./src/exec/set_exitstatus.c
Norme: ./src/exec/redirect_lessand.c
Norme: ./src/exec/token_to_argv.c
Norme: ./src/glob/esc_print.c
Norme: ./src/glob/dir_glob.c
Norme: ./src/glob/command_getoutput.c
Error: global scope bad aligned
Error (line 47): line has 83 characters
Error (line 52): function execute_command has 26 lines
Norme: ./src/glob/expand_home.c
Norme: ./src/glob/expand_esc.c
Norme: ./src/glob/ft_strsplit_esc.c
Error (line 69): line has 84 characters
Norme: ./src/glob/expand_brace.c
Norme: ./src/glob/expand_var.c
Norme: ./src/glob/gen_tab_esc.c
Norme: ./src/glob/is_char_esc.c
Norme: ./src/glob/ft_strsplit_spe.c
Norme: ./src/glob/tab_esc_copy.c
Norme: ./src/glob/word_is_assignment.c
Norme: ./src/glob/glob.c
Norme: ./src/hash_table/hash.c
Norme: ./src/hash_table/ft_add_hash.c
Norme: ./src/hash_table/hash_str.c
Norme: ./src/hash_table/hash_free.c
Norme: ./src/hash_table/is_hash.c
Norme: ./src/history/add_str_in_history.c
Norme: ./src/glob/expand_bquote.c
Error: 6 functions in the file
Norme: ./src/history/history.c
Norme: ./src/history/history_parsing_toolz_2.c
Norme: ./src/history/history_parsing_toolz.c
Norme: ./src/history/list_toolz.c
Norme: ./src/glob/match_pattern.c
Error (line 75): line has 82 characters
Norme: ./src/history/history_parsing.c
Norme: ./src/job_control/builtin_bg.c
Norme: ./src/job_control/do_job_notification.c
Norme: ./src/job_control/builtin_fg.c
Error (line 15): function builtin_fg has 31 lines
Norme: ./src/job_control/has_running_job.c
Norme: ./src/history/surch_in_history.c
Norme: ./src/job_control/has_stopped_job.c
Norme: ./src/job_control/job_cmp_id.c
Norme: ./src/job_control/job_format.c
Norme: ./src/job_control/job_addprocess.c
Error (line 27): comment not well formatted
Error (line 27): comment not well placed
Norme: ./src/job_control/job_free.c
Norme: ./src/job_control/builtin_jobs.c
Norme: ./src/job_control/job_format_head.c
Norme: ./src/job_control/job_getprocess.c
Norme: ./src/job_control/job_hup_all.c
Norme: ./src/job_control/job_is_completed.c
Norme: ./src/job_control/job_is_stopped.c
Norme: ./src/job_control/job_notify_change.c
Norme: ./src/job_control/job_getrank.c
Norme: ./src/job_control/job_run.c
Norme: ./src/job_control/job_notify_new.c
Norme: ./src/job_control/job_update_id.c
Norme: ./src/job_control/job_remove.c
Norme: ./src/job_control/job_update_status.c
Norme: ./src/job_control/pprint_brace.c
Norme: ./src/job_control/mark_job_as_running.c
Norme: ./src/job_control/pprint_case.c
Norme: ./src/job_control/pprint_cmd.c
Norme: ./src/job_control/pprint_for.c
Norme: ./src/job_control/pprint_function.c
Norme: ./src/job_control/pprint_if.c
Norme: ./src/job_control/pprint_until.c
Norme: ./src/job_control/pprint_subshell.c
Norme: ./src/job_control/pprint_while.c
Norme: ./src/job_control/job_wait.c
Norme: ./src/job_control/process_cmp_pid.c
Norme: ./src/job_control/put_job_in_background.c
Norme: ./src/job_control/process_free.c
Norme: ./src/job_control/sigchld_handler.c
Norme: ./src/job_control/sigint_handler.c
Norme: ./src/job_control/sigtstp_handler.c
Norme: ./src/job_control/sigttou_handler.c
Norme: ./src/job_control/sigttin_handler.c
Norme: ./src/lexer/get_lexer_stack.c
Norme: ./src/job_control/put_job_in_foreground.c
Norme: ./src/lexer/do_lexer_routine.c
Error (line 15): function do_lexer_routine has 27 lines
Error (line 24): missing newline after if
Error (line 24): spaces at the end of line
Error (line 28): spaces at the end of line
Norme: ./src/lexer/get_state_redir.c
Norme: ./src/lexer/get_state_global.c
Norme: ./src/lexer/insert_newline.c
Norme: ./src/lexer/isrw_delim.c
Error (line 15): spaces at the end of line
Error (line 19): spaces at the end of line
Norme: ./src/lexer/keep_last_type.c
Error (line 22): spaces at the end of line
Error (line 22, col 0): no newline after block
Norme: ./src/lexer/get_reserved_words.c
Error (line 41): spaces at the end of line
Norme: ./src/lexer/lexer_backslash.c
Norme: ./src/job_control/process_format.c
Norme: ./src/lexer/lexer_default.c
Norme: ./src/lexer/lexer_destroy.c
Norme: ./src/lexer/lexer_bquote.c
Norme: ./src/lexer/lexer_curly_braces.c
Norme: ./src/lexer/lexer_delim.c
Norme: ./src/lexer/lexer_end.c
Norme: ./src/lexer/lexer_heredoc.c
Norme: ./src/lexer/lexer_init.c
Norme: ./src/lexer/lexer_great.c
Norme: ./src/lexer/lexer_newline.c
Norme: ./src/lexer/lexer_dquote.c
Norme: ./src/lexer/lexer_less.c
Norme: ./src/lexer/lexer_lex.c
Norme: ./src/lexer/lexer_paren.c
Norme: ./src/lexer/lexer_quote.c
Norme: ./src/lexer/lexer_number.c
Norme: ./src/lexer/token_cmp_type.c
Norme: ./src/lexer/lexer_word.c
Norme: ./src/lexer/lexer_sep.c
Norme: ./src/lexer/token_free.c
Norme: ./src/lexer/token_print.c
Norme: ./src/lexer/token_init.c
Norme: ./src/lexer/token_append.c
Norme: ./src/line_editing/control_features.c
Norme: ./src/line_editing/completion.c
Norme: ./src/line_editing/home_end.c
Norme: ./src/line_editing/copy_cut_paste.c
Error (line 40): function ft_v has 26 lines
Norme: ./src/line_editing/init_line.c
Norme: ./src/line_editing/init_history.c
Norme: ./src/line_editing/init_termcaps.c
Norme: ./src/line_editing/ft_prompt.c
Norme: ./src/line_editing/get_key.c
Norme: ./src/line_editing/move_left_and_right.c
Norme: ./src/line_editing/move_up_and_down.c
Norme: ./src/line_editing/readline.c
Error (line 15): function readline has 27 lines
Norme: ./src/line_editing/resize.c
Norme: ./src/line_editing/queue.c
Norme: ./src/main/data_exit.c
Norme: ./src/line_editing/print_and_del.c
Norme: ./src/main/data_singleton.c
Norme: ./src/line_editing/move_to_word.c
Norme: ./src/main/data_init.c
Error (line 15, col 14): global named environ is not well prefixed
Error (line 46): function data_init has 30 lines
Error (line 68): comment not well formatted
Error (line 68): bad indentation
Error (line 68): comment not well placed
Error (line 70): comment not well formatted
Error (line 70): comment not well placed
Norme: ./src/main/main.c
Norme: ./src/parser/add_bang.c
Norme: ./src/main/ft_putast.c
Error (line 15): function ft_putast has 83 lines
Error (line 15): declarations must be followed by one empty line in ft_putast
Error (line 19): spaces at the end of line
Error (line 52, col 21): missing space around ==
Norme: ./src/main/shell_init.c
Error (line 31): function get_input_fd has 30 lines
Norme: ./src/parser/add_case.c
Norme: ./src/parser/add_cmd.c
Norme: ./src/parser/add_condition.c
Norme: ./src/parser/add_number.c
Norme: ./src/parser/add_loop.c
Norme: ./src/parser/add_sep.c
Norme: ./src/parser/add_func.c
Error (line 97, col 3): missing space after break
Error (line 100): spaces at the end of line
Error (line 120): must begin only by tabulations
Norme: ./src/parser/add_subshell.c
Norme: ./src/parser/do_parser_routine.c
Norme: ./src/parser/build_tree.c
Norme: ./src/parser/error_syntax.c
Norme: ./src/parser/add_redir.c
Norme: ./src/parser/heredoc_parser.c
Norme: ./src/parser/ft_parse.c
Norme: ./src/parser/parser_init.c
Norme: ./src/parser/parser_destroy.c
Norme: ./src/parser/pop_stack.c
Norme: ./src/parser/push_stack.c
Norme: ./src/parser/redir_init.c
Norme: ./src/parser/stack_init.c
Norme: ./src/parser/sym_free.c
Norme: ./src/parser/tree_func_free.c
Norme: ./src/parser/tree_wrapper.c
Norme: ./src/parser/produce_sym.c
Norme: ./src/parser/aggregate_sym.c
Norme: ./src/parser/eval_sym.c

View file

@ -6,7 +6,7 @@
/* By: wescande <wescande@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/03/07 15:47:30 by wescande #+# #+# */
/* Updated: 2017/03/21 18:52:16 by ariard ### ########.fr */
/* Updated: 2017/03/21 20:15:59 by ariard ### ########.fr */
/* */
/* ************************************************************************** */
@ -14,7 +14,7 @@
t_process_map g_process_map[] =
{
{PROCESS_FUNCTION, plaunch_function, pprint_function, pfree_subshell},
{PROCESS_FUNCTION, plaunch_function, pprint_function, pfree_func},
{PROCESS_BUILTIN, plaunch_builtin, pprint_cmd, pfree_cmd},
{PROCESS_FILE, plaunch_file, pprint_cmd, pfree_cmd},
{PROCESS_SUBSHELL, plaunch_subshell, pprint_subshell, pfree_subshell},

View file

@ -6,7 +6,7 @@
/* By: wescande <wescande@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/03/08 02:45:15 by wescande #+# #+# */
/* Updated: 2017/03/20 14:07:39 by jhalford ### ########.fr */
/* Updated: 2017/03/21 21:17:59 by ariard ### ########.fr */
/* */
/* ************************************************************************** */
@ -17,19 +17,22 @@ t_btree *is_function(t_process *p)
t_list *tmp;
t_btree **ast;
char **av;
int ret;
tmp = data_singleton()->lst_func;
while (tmp)
ret = 1;
while (tmp && ret)
{
ast = tmp->content;
if (!*ast)
return (NULL);
av = token_to_argv(((t_astnode *)(*ast)->item)->data.cmd.token, 1);
if (!av || !av[0])
return (NULL);
if (!ft_strcmp(av[0], p->data.cmd.av[0]))
return (btree_map((*ast)->right, node_copy));
if (av && av[0] && !ft_strcmp(av[0], p->data.cmd.av[0]))
ret = 0;
ft_tabdel(&av);
tmp = tmp->next;
}
if (!ret)
return (btree_map((*ast)->right, node_copy));
return (NULL);
}

View file

@ -0,0 +1,20 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* pfree_func.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ariard <ariard@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/03/21 20:18:34 by ariard #+# #+# */
/* Updated: 2017/03/21 20:53:45 by ariard ### ########.fr */
/* */
/* ************************************************************************** */
#include "minishell.h"
int pfree_func(t_process *p)
{
ft_putstr("hello");
btree_del(&p->data.function.content, &ast_free);
return (0);
}

View file

@ -6,7 +6,7 @@
/* By: wescande <wescande@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/03/08 02:38:12 by wescande #+# #+# */
/* Updated: 2017/03/20 15:50:05 by gwojda ### ########.fr */
/* Updated: 2017/03/21 20:03:21 by ariard ### ########.fr */
/* */
/* ************************************************************************** */

View file

@ -6,7 +6,7 @@
/* By: wescande <wescande@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/03/08 03:23:59 by wescande #+# #+# */
/* Updated: 2017/03/21 18:10:44 by ariard ### ########.fr */
/* Updated: 2017/03/21 20:59:57 by ariard ### ########.fr */
/* */
/* ************************************************************************** */
@ -16,14 +16,19 @@
int plaunch_function(t_process *p)
{
char *temp;
char *func_lvl;
int value;
if ((func_lvl = ft_sstrstr(data_singleton()->env, "FUNC_LVL")))
func_lvl = ft_sstrstr(data_singleton()->env, "FUNC_LVL");
if ((temp = func_lvl))
{
func_lvl += ft_strlenchr(func_lvl, '=') + 1;
if ((value = ft_atoi(func_lvl)) >= 199)
{
ft_strdel(&temp);
return (SH_ERR(FUNCERR_0));
}
value += 1;
}
else
@ -31,5 +36,6 @@ int plaunch_function(t_process *p)
builtin_setenv("setenv", (char *[]){"env", "FUNC_LVL",
ft_itoa(value), 0}, NULL);
ft_exec(&p->data.function.content);
DG();
return (ft_atoi(ft_getenv(data_singleton()->env, "?")));
}

View file

@ -6,7 +6,7 @@
/* By: jhalford <jhalford@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/03/13 22:21:19 by jhalford #+# #+# */
/* Updated: 2017/03/21 18:52:29 by ariard ### ########.fr */
/* Updated: 2017/03/21 20:53:04 by ariard ### ########.fr */
/* */
/* ************************************************************************** */
@ -59,7 +59,6 @@ int process_launch(t_process *p)
p->state = PROCESS_RUNNING;
if (!(pid = do_the_fork_if_i_have_to(p)))
{
DG("NO_FORK");
process_resetfds(p);
process_free(p, 0);
return (1);

View file

@ -6,7 +6,7 @@
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/03/09 14:51:23 by jhalford #+# #+# */
/* Updated: 2017/03/21 13:16:20 by jhalford ### ########.fr */
/* Updated: 2017/03/21 20:54:20 by ariard ### ########.fr */
/* */
/* ************************************************************************** */

View file

@ -6,7 +6,7 @@
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/03/20 12:41:54 by jhalford #+# #+# */
/* Updated: 2017/03/20 16:28:02 by jhalford ### ########.fr */
/* Updated: 2017/03/21 21:10:58 by ariard ### ########.fr */
/* */
/* ************************************************************************** */

View file

@ -6,7 +6,7 @@
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/12/12 12:41:11 by jhalford #+# #+# */
/* Updated: 2017/03/20 18:58:03 by wescande ### ########.fr */
/* Updated: 2017/03/21 20:49:32 by ariard ### ########.fr */
/* */
/* ************************************************************************** */

View file

@ -6,7 +6,7 @@
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/11/28 14:39:01 by jhalford #+# #+# */
/* Updated: 2017/03/16 19:10:40 by ariard ### ########.fr */
/* Updated: 2017/03/21 20:37:47 by ariard ### ########.fr */
/* */
/* ************************************************************************** */

View file

@ -6,7 +6,7 @@
/* By: gwojda <gwojda@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/03/20 14:45:40 by gwojda #+# #+# */
/* Updated: 2017/03/21 19:05:45 by ariard ### ########.fr */
/* Updated: 2017/03/21 21:18:34 by ariard ### ########.fr */
/* */
/* ************************************************************************** */

View file

@ -6,7 +6,7 @@
/* By: ariard <ariard@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/02/24 23:43:07 by ariard #+# #+# */
/* Updated: 2017/03/21 19:36:30 by ariard ### ########.fr */
/* Updated: 2017/03/21 20:01:37 by ariard ### ########.fr */
/* */
/* ************************************************************************** */
@ -116,10 +116,8 @@ int add_one_func(t_btree **ast, t_list **lst)
(void)lst;
func_ast = btree_map(*ast, &node_copy);
if ((old_func = is_already_func(&func_ast)))
{
ft_lst_delif(&data_singleton()->lst_func,
old_func->content, &ft_addrcmp, &tree_func_free);
}
ft_lsteadd(&data_singleton()->lst_func, ft_lstnew(&func_ast, sizeof(*ast)));
return (0);
}

View file

@ -6,7 +6,7 @@
/* By: ariard <ariard@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/03/21 19:02:54 by ariard #+# #+# */
/* Updated: 2017/03/21 19:14:16 by ariard ### ########.fr */
/* Updated: 2017/03/21 19:44:21 by ariard ### ########.fr */
/* */
/* ************************************************************************** */
@ -19,4 +19,5 @@ void tree_func_free(void *data, size_t content_size)
(void)content_size;
root = data;
btree_del(root, &ast_free);
free(root);
}