diff options
Diffstat (limited to 'src/ft_select_get.c')
-rw-r--r-- | src/ft_select_get.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/src/ft_select_get.c b/src/ft_select_get.c index b5df1bc..4ec1a45 100644 --- a/src/ft_select_get.c +++ b/src/ft_select_get.c @@ -42,10 +42,22 @@ static int8_t } static int8_t + ft_check_exists_two(const int8_t ret, t_cub *clist) +{ + if (ret == 12) + return (12); + if (ret == 8 && (clist->mlist->nlevel_path[0])) + return (-1); + if (ret == 9 && (clist->mlist->nl_tex_path[0])) + return (-1); + return (ret); +} + +static int8_t ft_get_id(char **words, t_cub *clist) { int8_t ret; - char ref[9][3]; + char ref[11][3]; ft_memcpy(ref[0], "R\0", 3); ft_memcpy(ref[1], "NO", 3); @@ -55,13 +67,17 @@ static int8_t ft_memcpy(ref[5], "S\0", 3); ft_memcpy(ref[6], "F\0", 3); ft_memcpy(ref[7], "C\0", 3); - ft_memcpy(ref[8], "", 1); + ft_memcpy(ref[8], "L\0", 3); + ft_memcpy(ref[9], "LT\0", 3); + ft_memcpy(ref[10], "", 1); ret = 0; while (ft_strncmp(words[0], ref[ret], 3) && ref[ret][0]) ret++; - if (ret == 8) + if (ret == 10) ret = 12; - return (ret = ft_check_exists(ret, clist)); + ret = ft_check_exists(ret, clist); + ret = ft_check_exists_two(ret, clist); + return (ret); } int8_t |