generic.c file split

This commit is contained in:
LuckyLaszlo
2021-12-16 04:01:29 +01:00
parent f53969cd45
commit 20c71bccbb
9 changed files with 322 additions and 251 deletions

View File

@@ -0,0 +1,29 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_is_posix_name.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: lperrey <lperrey@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/10/08 09:25:35 by lperrey #+# #+# */
/* Updated: 2021/12/16 03:50:43 by lperrey ### ########.fr */
/* */
/* ************************************************************************** */
#include "minishell.h"
int ft_is_posix_name(char *str)
{
unsigned int i;
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);
}