/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_is_in_quote.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: cchauvet int ft_is_in_quote(const char *str, size_t n) { ssize_t i; i = -1; while (str[++i] != '\0' && i < (ssize_t) n) { if (str[i] == '\'') { i++; while (str[i] != '\'' && str[i] != '\0') { if (i == (ssize_t) n) return (1); i++; } } if (str[i] == '"') { while (str[++i] != '"' && str[i] != '\0') if (i == (ssize_t) n) return (2); } } return (0); }