diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-08-26 17:09:43 +0200 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-08-26 17:09:43 +0200 |
commit | 76748544fde8c95125ff0b40643f8e2720fe9308 (patch) | |
tree | cc76fa2544b619ee749e997812096dd603a5df65 /src/b_sqb_str.c | |
parent | New files (diff) | |
download | 42-minishell-76748544fde8c95125ff0b40643f8e2720fe9308.tar.gz 42-minishell-76748544fde8c95125ff0b40643f8e2720fe9308.tar.bz2 42-minishell-76748544fde8c95125ff0b40643f8e2720fe9308.tar.xz 42-minishell-76748544fde8c95125ff0b40643f8e2720fe9308.tar.zst 42-minishell-76748544fde8c95125ff0b40643f8e2720fe9308.zip |
Strings comp done
Diffstat (limited to 'src/b_sqb_str.c')
-rw-r--r-- | src/b_sqb_str.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/b_sqb_str.c b/src/b_sqb_str.c index 0b23d7b..7c6a160 100644 --- a/src/b_sqb_str.c +++ b/src/b_sqb_str.c @@ -10,10 +10,25 @@ /* */ /* ************************************************************************** */ +#include <libft.h> #include <stdint.h> #include "d_define.h" +static t_bool + b_sqb_str_comp(uint8_t id, + const char s_one[], + const char s_two[]) +{ + if (id == FT_ID_SQB_EQUA && + ft_strncmp(s_one, s_two, ft_strlen(s_one) + 1) == 0) + return (TRUE); + else if (id == FT_ID_SQB_EQUA && + ft_strncmp(s_one, s_two, ft_strlen(s_one) + 1) != 0) + return (TRUE); + return (FALSE); +} + uint8_t b_sqb_str(uint8_t id, char *argv[]) @@ -25,5 +40,7 @@ uint8_t else return (1); } + if (b_sqb_str_comp(id, argv[0], argv[2]) == TRUE) + return (0); return (1); } |