diff options
Diffstat (limited to 'src/ft_e_lcom.c')
-rw-r--r-- | src/ft_e_lcom.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/ft_e_lcom.c b/src/ft_e_lcom.c index c592f3c..b928004 100644 --- a/src/ft_e_lcom.c +++ b/src/ft_e_lcom.c @@ -17,7 +17,7 @@ static uint8_t ft_get_builtin_id(const char com[], - t_msh *msh) + t_msh *msh) { uint8_t i; @@ -32,20 +32,22 @@ static uint8_t int32_t ft_e_lcom(t_msh *msh) { + t_lcom *ptr; uint8_t bu_id; - while (msh->lcom_head != NULL) + ptr = msh->curr; + while (ptr != NULL) { - if ((bu_id = ft_get_builtin_id(msh->lcom_head->com, msh)) + if ((bu_id = ft_get_builtin_id(ptr->com, msh)) < FT_BUILTINS_COUNT) { - msh->bu_ptr[bu_id](msh->lcom_head->args, msh); + msh->bu_ptr[bu_id](ptr->args, msh); } else { /* TODO: exec path stuff */ } - msh->lcom_head = msh->lcom_head->next; + ptr = ptr->next; } return (0); } |