diff --git a/srcs/check_syntax_utils.c b/srcs/check_syntax_utils.c index 8c6fd38..32cf586 100644 --- a/srcs/check_syntax_utils.c +++ b/srcs/check_syntax_utils.c @@ -6,7 +6,7 @@ /* By: tomoron +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/04/24 14:54:53 by tomoron #+# #+# */ -/* Updated: 2024/04/24 14:55:56 by tomoron ### ########.fr */ +/* Updated: 2024/04/24 18:57:48 by marde-vr ### ########.fr */ /* */ /* ************************************************************************** */ @@ -38,7 +38,7 @@ int check_tokens_syntax(t_cmd *cmd, t_cmd *last, t_env *env) return (0); } token = parse_cmds_to_token(cmd, env); - if (!token) + if (token == (void *)1) return (0); free_token(token); return (1); diff --git a/srcs/exec_bonus.c b/srcs/exec_bonus.c index 4d83a4b..24e0c80 100755 --- a/srcs/exec_bonus.c +++ b/srcs/exec_bonus.c @@ -6,7 +6,7 @@ /* By: marde-vr +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/03/28 13:50:14 by tomoron #+# #+# */ -/* Updated: 2024/04/24 15:22:20 by tomoron ### ########.fr */ +/* Updated: 2024/04/24 18:55:58 by marde-vr ### ########.fr */ /* */ /* ************************************************************************** */ @@ -116,7 +116,10 @@ void exec_commands(t_msh *msh) int i; if (!msh->tokens && !is_parenthesis(msh->cmds)) + { + g_return_code = 0; return ; + } cmd_count = get_cmd_count(msh->cmds); msh->fds = ft_calloc(cmd_count + 1, sizeof(int **)); msh->pids = ft_calloc(cmd_count, sizeof(int *)); diff --git a/srcs/utils_bonus.c b/srcs/utils_bonus.c index 34a3e5e..73e8101 100755 --- a/srcs/utils_bonus.c +++ b/srcs/utils_bonus.c @@ -6,7 +6,7 @@ /* By: tomoron +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/03/27 17:19:27 by tomoron #+# #+# */ -/* Updated: 2024/04/18 20:49:00 by marde-vr ### ########.fr */ +/* Updated: 2024/04/24 18:59:26 by marde-vr ### ########.fr */ /* */ /* ************************************************************************** */ @@ -16,7 +16,7 @@ t_token *parsing_syntax_error(t_token *res) { free_token(res); ft_putstr_fd("minishell: syntax error\n", 2); - return (0); + return ((void *)1); } int is_input_type(t_cmd *cmd) diff --git a/todo_list b/todo_list index 9495302..9d6f4ef 100644 --- a/todo_list +++ b/todo_list @@ -1,13 +1,6 @@ -#invalid command, followed by empty variable, should clear the exit code -doesntexist -$EMPTY -echo $? - To test: test signals test and verify all malocs verify forbidden functions check for any hidden or useless files - -return code 0 quand liste token est a 0