summaryrefslogtreecommitdiffstats
path: root/src/e_line.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_line.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_line.c')
-rw-r--r--src/e_line.c17
1 files changed, 2 insertions, 15 deletions
diff --git a/src/e_line.c b/src/e_line.c
index bb97556..caf3d75 100644
--- a/src/e_line.c
+++ b/src/e_line.c
@@ -20,20 +20,7 @@
#include "s_lpipes.h"
#include "s_com.h"
#include "s_struct.h"
-
-static uint8_t
- e_get_builtin_id(const char bin[], t_msh *msh)
-{
- uint8_t i;
-
- i = 0;
- while (msh->bu_ref[i] != NULL && ft_strncmp(bin, msh->bu_ref[i],
- ft_strlen(msh->bu_ref[i]) + 1) != 0)
- {
- i++;
- }
- return (i);
-}
+#include "u_utils.h"
void
e_line(t_msh *msh)
@@ -45,7 +32,7 @@ void
else if (msh->com != NULL)
{
if (msh->com->bin != NULL &&
- (bu_id = e_get_builtin_id(msh->com->bin, msh))
+ (bu_id = u_get_builtin_id(msh->com->bin))
< FT_BUILTINS_COUNT)
e_builtin(msh->com, bu_id, msh);
else if (msh->com->bin != NULL)