summaryrefslogtreecommitdiffstats
path: root/src/e_externs_pipes.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-09-15 20:44:45 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2020-09-15 20:44:45 +0200
commit33a5806163fb91e4a72e188a9933ada20395f4e9 (patch)
tree24854a47dfc8fd77a0c4bf52c04f7b5c64e48cdc /src/e_externs_pipes.c
parentInit fix (diff)
download42-minishell-33a5806163fb91e4a72e188a9933ada20395f4e9.tar.gz
42-minishell-33a5806163fb91e4a72e188a9933ada20395f4e9.tar.bz2
42-minishell-33a5806163fb91e4a72e188a9933ada20395f4e9.tar.xz
42-minishell-33a5806163fb91e4a72e188a9933ada20395f4e9.tar.zst
42-minishell-33a5806163fb91e4a72e188a9933ada20395f4e9.zip
Builtins ref toked
Diffstat (limited to 'src/e_externs_pipes.c')
-rw-r--r--src/e_externs_pipes.c19
1 files changed, 2 insertions, 17 deletions
diff --git a/src/e_externs_pipes.c b/src/e_externs_pipes.c
index 05a2cf7..ca843d0 100644
--- a/src/e_externs_pipes.c
+++ b/src/e_externs_pipes.c
@@ -29,21 +29,6 @@
#include "u_path.h"
#include "u_utils.h"
-static uint8_t
- get_builtin_id(const char com[],
- t_msh *msh)
-{
- uint8_t i;
-
- i = 0;
- while (msh->bu_ref[i] && ft_strncmp(com, msh->bu_ref[i],
- ft_strlen(msh->bu_ref[i]) + 1) != 0)
- {
- i++;
- }
- return (i);
-}
-
static void
e_pipe_child(char *fullpath[],
uint8_t pipe_id,
@@ -56,7 +41,7 @@ static void
dup_redirs(ptr, msh);
if (ft_strncmp(fullpath[pipe_id], "builtin", 8) == 0)
{
- bu_id = get_builtin_id(ptr->bin, msh);
+ bu_id = u_get_builtin_id(ptr->bin);
ret = msh->bu_ptr[bu_id](ptr->argv + 1, msh);
u_eof_fd(msh->fd);
s_lpipes_clear(&msh->pipes);
@@ -166,7 +151,7 @@ void
}
else
{
- if ((bu_id = get_builtin_id(rptr->com->bin, msh))
+ if ((bu_id = u_get_builtin_id(rptr->com->bin))
< FT_BUILTINS_COUNT)
{
if ((fullpath[i] = ft_strdup("builtin")) == NULL)