diff options
Diffstat (limited to 'src/p_lcom_next.c')
-rw-r--r-- | src/p_lcom_next.c | 30 |
1 files changed, 30 insertions, 0 deletions
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 <stdlib.h> #include <stdint.h> +#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); + } +} |