fixed syntax error error code and exit too big

This commit is contained in:
mdev9
2024-04-25 13:45:13 +02:00
parent 7f85951e43
commit bee12290d5
4 changed files with 13 additions and 5 deletions

View File

@ -6,7 +6,7 @@
/* By: tomoron <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/04/24 14:50:15 by tomoron #+# #+# */
/* Updated: 2024/04/24 15:00:00 by tomoron ### ########.fr */
/* Updated: 2024/04/25 13:02:46 by marde-vr ### ########.fr */
/* */
/* ************************************************************************** */
@ -20,12 +20,14 @@ int check_parens_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);
}
parsed_cmd = parsing_bonus(cmd->value);
if (!parsed_cmd)
{
ft_putstr_fd("minishell: syntax error\n", 2);
g_return_code = 2;
return (0);
}
tmp = check_cmds_syntax(parsed_cmd, env);
@ -110,6 +112,9 @@ int check_str_syntax(char *cmd)
cmd++;
}
if (in_quote || in_dquote || parenthesis)
{
ft_putstr_fd("minishell: syntax error\n", 2);
g_return_code = 2;
}
return (!(in_quote || in_dquote || parenthesis));
}