/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_is_posix_name.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: lperrey +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2021/10/08 09:25:35 by lperrey #+# #+# */ /* Updated: 2021/12/18 13:31:11 by lperrey ### ########.fr */ /* */ /* ************************************************************************** */ #include "minishell.h" int ft_is_posix_name(char *str) { unsigned int i; if (!str) return (0); if (str[0] != '_' && !ft_isalpha(str[0])) return (0); i = 1; while (str[i]) { if (str[i] != '_' && !ft_isalnum(str[i])) return (0); i++; } return (i); }