fixed syntax error error code and exit too big
This commit is contained in:
@ -6,7 +6,7 @@
|
||||
/* By: tomoron <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/04/24 14:54:53 by tomoron #+# #+# */
|
||||
/* Updated: 2024/04/24 18:57:48 by marde-vr ### ########.fr */
|
||||
/* Updated: 2024/04/25 13:03:37 by marde-vr ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -17,6 +17,7 @@ void print_syntax_error_bonus(t_cmd *cmd)
|
||||
if (cmd->cmd_type == CMD || cmd->cmd_type == PAREN)
|
||||
return ;
|
||||
ft_printf_fd(2, "minishell : syntax error near unexpected token `");
|
||||
g_return_code = 2;
|
||||
if (cmd->cmd_type == AND)
|
||||
ft_printf_fd(2, "&&");
|
||||
if (cmd->cmd_type == OR)
|
||||
@ -35,6 +36,7 @@ int check_tokens_syntax(t_cmd *cmd, t_cmd *last, t_env *env)
|
||||
if (last && is_cmd_type(last))
|
||||
{
|
||||
ft_putstr_fd("minishell : syntax error\n", 2);
|
||||
g_return_code = 2;
|
||||
return (0);
|
||||
}
|
||||
token = parse_cmds_to_token(cmd, env);
|
||||
|
Reference in New Issue
Block a user