diff --git a/42sh/Makefile b/42sh/Makefile index e756e7d5..c84761fb 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/21 15:06:37 by gwojda ### ########.fr # +# Updated: 2017/03/21 15:47:55 by ariard ### ########.fr # # # # **************************************************************************** # NAME = 42sh CC = gcc -FLAGS = -Wall -Wextra -Werror #-fvisibility=hidden #-fsanitize=address +FLAGS = -Wall -Wextra -Werror -fvisibility=hidden -fsanitize=address D_FLAGS = -g DELTA = $$(echo "$$(tput cols)-47"|bc) diff --git a/42sh/src/main/main.c b/42sh/src/main/main.c index c419a0d2..0745d3dc 100644 --- a/42sh/src/main/main.c +++ b/42sh/src/main/main.c @@ -6,7 +6,7 @@ /* By: gwojda +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/03/20 14:45:40 by gwojda #+# #+# */ -/* Updated: 2017/03/21 14:04:33 by jhalford ### ########.fr */ +/* Updated: 2017/03/21 16:12:37 by ariard ### ########.fr */ /* */ /* ************************************************************************** */ @@ -43,8 +43,10 @@ static int handle_instruction(t_list **token, t_btree **ast) return (ret); if (do_lexer_routine(token, stream) > 0) continue ; - if (do_parser_routine(token, ast) > 0) + if ((ret = do_parser_routine(token, ast)) > 1) break ; + else if (ret == 1) + return (ret); } if (data->parser.state == SUCCESS && ft_exec(ast) < 0) exit(1); diff --git a/42sh/src/parser/do_parser_routine.c b/42sh/src/parser/do_parser_routine.c index 2f9671b9..18e64b84 100644 --- a/42sh/src/parser/do_parser_routine.c +++ b/42sh/src/parser/do_parser_routine.c @@ -6,7 +6,7 @@ /* By: wescande +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/03/19 14:24:14 by wescande #+# #+# */ -/* Updated: 2017/03/20 21:11:21 by jhalford ### ########.fr */ +/* Updated: 2017/03/21 16:09:48 by ariard ### ########.fr */ /* */ /* ************************************************************************** */ @@ -31,6 +31,6 @@ int do_parser_routine(t_list **token, t_btree **ast) return (1); } else if (data->parser.state == SUCCESS) - return (1); + return (2); return (0); }