diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-07-30 22:14:06 +0200 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-07-30 22:14:06 +0200 |
commit | db381c5a5d8755937663a5ea61e655186f7606e7 (patch) | |
tree | e0cd8079eda191e838e994e8f31a83f838b6bf79 /src/p_lcom_next.c | |
parent | Double exit no more (diff) | |
download | 42-minishell-db381c5a5d8755937663a5ea61e655186f7606e7.tar.gz 42-minishell-db381c5a5d8755937663a5ea61e655186f7606e7.tar.bz2 42-minishell-db381c5a5d8755937663a5ea61e655186f7606e7.tar.xz 42-minishell-db381c5a5d8755937663a5ea61e655186f7606e7.tar.zst 42-minishell-db381c5a5d8755937663a5ea61e655186f7606e7.zip |
Not too bad
Diffstat (limited to '')
-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); + } +} |