From db381c5a5d8755937663a5ea61e655186f7606e7 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Thu, 30 Jul 2020 22:14:06 +0200 Subject: Not too bad --- src/p_lcom_next.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'src/p_lcom_next.c') diff --git a/src/p_lcom_next.c b/src/p_lcom_next.c index a0ca8d1..4d0ca72 100644 --- a/src/p_lcom_next.c +++ b/src/p_lcom_next.c @@ -14,6 +14,7 @@ #include #include +#include "d_enum.h" #include "s_struct.h" #include "u_vars.h" @@ -95,3 +96,32 @@ char ft_memdel((void*)&subst); return (words); } + +char + **p_check_first_arg_equals(char *words[]) +{ + t_bool equals; + char *ptr; + + equals = FALSE; + ptr = words[0]; + while (*ptr != '\0') + { + if (*ptr == '=') + { + equals = TRUE; + break ; + } + ptr++; + } + if (equals == TRUE && words[1] != NULL) + { + ft_memdel((void*)&words[0]); + words = words + 1; + return (words); + } + else + { + return (words); + } +} -- cgit v1.2.3