summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-08-25 23:33:27 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2020-08-25 23:33:27 +0200
commitc8a5f03103ac70d6525cab05ac85312099336989 (patch)
treeae3db612f17f6959e1a496e22259b88439066ff2
parentIn progress (diff)
download42-minishell-c8a5f03103ac70d6525cab05ac85312099336989.tar.gz
42-minishell-c8a5f03103ac70d6525cab05ac85312099336989.tar.bz2
42-minishell-c8a5f03103ac70d6525cab05ac85312099336989.tar.xz
42-minishell-c8a5f03103ac70d6525cab05ac85312099336989.tar.zst
42-minishell-c8a5f03103ac70d6525cab05ac85312099336989.zip
qweqwe
-rw-r--r--src/b_sqb.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/src/b_sqb.c b/src/b_sqb.c
index 91bf7b6..28e0fa6 100644
--- a/src/b_sqb.c
+++ b/src/b_sqb.c
@@ -25,26 +25,24 @@ static void
}
static uint8_t
- b_get_sqb_id(uint64_t argc,
- char *argv[],
+ b_get_sqb_id(char *argv[],
t_msh *msh)
{
- size_t j;
uint8_t i;
i = 0;
while (i < FT_ID_SQB_COUNT)
{
- j = 0;
- while (j < argc)
- {
- if (
- ft_strncmp(argv[j],
+ if (i < FT_ID_SQB_NT &&
+ ft_strncmp(argv[0],
msh->sqb_ref[i],
ft_strlen(msh->sqb_ref[i]) + 1) == 0)
- return (i);
- j++;
- }
+ return (i);
+ if (i >= FT_ID_SQB_NT &&
+ ft_strncmp(argv[1],
+ msh->sqb_ref[i],
+ ft_strlen(msh->sqb_ref[i]) + 1) == 0)
+ return (i);
i++;
}
return (i);
@@ -57,13 +55,13 @@ static uint8_t
{
uint8_t id;
- id = b_get_sqb_id(argc, argv, msh);
+ (void)argc;
+ id = b_get_sqb_id(argv, msh);
if (id == FT_ID_SQB_COUNT)
{
b_sqb_unexpected_operator(argv[0]);
return (2);
}
- ft_printf("[%s]\n", msh->sqb_ref[id]);
return (0);
}