diff --git a/srcs/check_syntax.c b/srcs/check_syntax.c index 73999cf..6beef4e 100644 --- a/srcs/check_syntax.c +++ b/srcs/check_syntax.c @@ -6,7 +6,7 @@ /* By: tomoron +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/04/24 14:50:15 by tomoron #+# #+# */ -/* Updated: 2024/04/25 13:15:19 by tomoron ### ########.fr */ +/* Updated: 2024/04/25 13:50:46 by tomoron ### ########.fr */ /* */ /* ************************************************************************** */ @@ -113,8 +113,8 @@ int check_str_syntax(char *cmd) } if (in_quote || in_dquote || parenthesis) { - g_return_code = 2; ft_putstr_fd("minishell: syntax error\n", 2); + g_return_code = 2; } return (!(in_quote || in_dquote || parenthesis)); } diff --git a/srcs/check_syntax_utils.c b/srcs/check_syntax_utils.c index 012c979..fd81b3a 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/25 13:15:00 by tomoron ### ########.fr */ +/* Updated: 2024/04/25 13:51:03 by tomoron ### ########.fr */ /* */ /* ************************************************************************** */ @@ -37,6 +37,7 @@ int check_tokens_syntax(t_cmd *cmd, t_cmd *last, t_env *env) { g_return_code = 2; ft_putstr_fd("minishell : syntax error\n", 2); + g_return_code = 2; return (0); } token = parse_cmds_to_token(cmd, env); diff --git a/srcs/exit.c b/srcs/exit.c index c370060..c6f5ae0 100755 --- a/srcs/exit.c +++ b/srcs/exit.c @@ -6,7 +6,7 @@ /* By: marde-vr +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/02/07 16:04:11 by tomoron #+# #+# */ -/* Updated: 2024/04/25 13:26:35 by tomoron ### ########.fr */ +/* Updated: 2024/04/25 13:51:19 by tomoron ### ########.fr */ /* */ /* ************************************************************************** */ @@ -25,7 +25,7 @@ void get_exit_bt_return_code(t_msh *msh, int *exit_code) t_token *cur_cmd; cur_cmd = msh->tokens->next; - if (cur_cmd && !ft_strisnbr(cur_cmd->value)) + if (cur_cmd && (!ft_strisnbr(cur_cmd->value) || ft_strlen(cur_cmd->value) > 18)) numeric_arg_err(cur_cmd->value, exit_code); else if (cur_cmd) *exit_code = (unsigned char)ft_atoi(cur_cmd->value); diff --git a/srcs/utils_bonus.c b/srcs/utils_bonus.c index 9812dbf..d5b9865 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/25 13:13:55 by tomoron ### ########.fr */ +/* Updated: 2024/04/25 13:51:44 by tomoron ### ########.fr */ /* */ /* ************************************************************************** */ @@ -16,7 +16,7 @@ t_token *parsing_syntax_error(t_token *res) { free_token(res); ft_putstr_fd("minishell: syntax error\n", 2); - g_return_code = 0; + g_return_code = 2; return ((void *)1); }