From cbb47afbbcc9b42f3094df620bbc0ef02aa7f3d2 Mon Sep 17 00:00:00 2001 From: Rudy Bousset Date: Fri, 28 Feb 2020 18:55:45 +0100 Subject: Parsed --- src/ft_select_get.c | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'src/ft_select_get.c') 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 @@ -41,11 +41,23 @@ static int8_t return (ret); } +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 -- cgit v1.2.3