diff --git a/42sh/Makefile b/42sh/Makefile index 4caa3e26..c81ce63e 100644 --- a/42sh/Makefile +++ b/42sh/Makefile @@ -6,14 +6,14 @@ # By: wescande +#+ +:+ +#+ # # +#+#+#+#+#+ +#+ # # Created: 2016/08/29 21:32:58 by wescande #+# #+# # -# Updated: 2017/03/27 03:12:30 by ariard ### ########.fr # +# Updated: 2017/03/27 15:09:22 by ariard ### ########.fr # # # # **************************************************************************** # NAME = 42sh CC = gcc -FLAGS = -Wall -Wextra -Werror #-fsanitize=address +FLAGS = -Wall -Wextra -Werror -fsanitize=address D_FLAGS = -g DELTA = $$(echo "$$(tput cols)-47"|bc) diff --git a/42sh/src/exec/exec_case_branch.c b/42sh/src/exec/exec_case_branch.c index 91fa3e1e..84dc6208 100644 --- a/42sh/src/exec/exec_case_branch.c +++ b/42sh/src/exec/exec_case_branch.c @@ -6,7 +6,7 @@ /* By: wescande +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/03/07 20:33:45 by wescande #+# #+# */ -/* Updated: 2017/03/22 22:10:26 by ariard ### ########.fr */ +/* Updated: 2017/03/27 15:05:49 by ariard ### ########.fr */ /* */ /* ************************************************************************** */ @@ -26,6 +26,7 @@ int exec_case_branch(t_btree **ast) if (av && (ft_strcmp(av[0], ((char **)exec->case_pattern)[0]) == 0)) { exec->attrs |= EXEC_CASE_BRANCH; + ft_tabdel(&exec->case_pattern); ft_exec(&(*ast)->right); } ft_tabdel(&av); diff --git a/42sh/src/exec/plaunch_case.c b/42sh/src/exec/plaunch_case.c index 3d3692ca..6c96e76e 100644 --- a/42sh/src/exec/plaunch_case.c +++ b/42sh/src/exec/plaunch_case.c @@ -6,7 +6,7 @@ /* By: wescande +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/03/07 19:02:23 by wescande #+# #+# */ -/* Updated: 2017/03/27 03:47:36 by ariard ### ########.fr */ +/* Updated: 2017/03/27 15:06:42 by ariard ### ########.fr */ /* */ /* ************************************************************************** */ @@ -18,8 +18,6 @@ int plaunch_case(t_process *p) exec = &data_singleton()->exec; exec->attrs &= ~EXEC_CASE_BRANCH; - if (exec->case_pattern && *exec->case_pattern) - ft_tabdel(&exec->case_pattern); exec->case_pattern = token_to_argv(p->data.d_case.token, 1); ft_exec(&p->data.d_case.content); ft_tabdel(&exec->case_pattern);