/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* syntax.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: cchauvet ", str[i])) { y = 0; while (str[i] == str[i + y]) y++; if ((y > 2 && (str[i] == '>' || str[i] == '<')) || (y > 1 && str[i] == '|')) { ft_eprintf("minishell: too many %s in a row\n", str); return (1); } i = i + y; } else if (str[i] != '\0') i++; } return (0); } static int ft_empty_verif(const char *str) { size_t i; i = 0; while (str[i] == ' ' || str[i] == '\t') i++; return (str[i] == '\0'); } int ft_syntax_verif(t_data *data, const char *str) { if (ft_empty_verif(str)) return (1); if (ft_quote_verif(str) || ft_pipe_is_alone(str) || ft_special_char_dub(str)) { *data->exit_code = 2; return (1); } return (0); }