diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/ft_e_externs.c | 2 | ||||
-rw-r--r-- | src/ft_e_lcom.c | 16 | ||||
-rw-r--r-- | src/ft_m_loop.c | 1 | ||||
-rw-r--r-- | src/ft_p_lcom.c | 7 | ||||
-rw-r--r-- | src/ft_p_lcom_next.c | 4 | ||||
-rw-r--r-- | src/ft_s_lcom.c | 4 |
6 files changed, 23 insertions, 11 deletions
diff --git a/src/ft_e_externs.c b/src/ft_e_externs.c index 58459e8..4cdcc3c 100644 --- a/src/ft_e_externs.c +++ b/src/ft_e_externs.c @@ -70,7 +70,7 @@ void if (ft_ischarset("/.", ptr->com[0])) { - /* TODO: ft_get_absolute_path(ptr->com); */ + /* TODO: ft_get_physical_path(ptr->com); */ } else if ((envpath = ft_get_env_path(msh)) != NULL) { diff --git a/src/ft_e_lcom.c b/src/ft_e_lcom.c index 6b01dc4..57998cb 100644 --- a/src/ft_e_lcom.c +++ b/src/ft_e_lcom.c @@ -39,13 +39,17 @@ void ptr = msh->curr; while (ptr != NULL) { - if ((bu_id = ft_get_builtin_id(ptr->com, msh)) < FT_BUILTINS_COUNT) + /* TODO: FIX THAT */ + if (ptr->com[0]) { - ft_e_builtin(ptr, bu_id, msh); - } - else - { - ft_e_extern(ptr, msh); + if ((bu_id = ft_get_builtin_id(ptr->com, msh)) < FT_BUILTINS_COUNT) + { + ft_e_builtin(ptr, bu_id, msh); + } + else + { + ft_e_extern(ptr, msh); + } } ptr = ptr->next; } diff --git a/src/ft_m_loop.c b/src/ft_m_loop.c index 7f805a2..14f40a9 100644 --- a/src/ft_m_loop.c +++ b/src/ft_m_loop.c @@ -36,6 +36,7 @@ uint8_t ft_memdel((void*)&line); ft_e_lcom(msh); ft_lcom_clear(&msh->curr); + /* TODO: segv on spaces only "msh ~> " */ /* TODO: segv on ';' terminated lines "msh ~> echo qwe;" */ /* TODO: (null): Bad address on "msh ~> echo a > asd; cat < asd" but not on "msh ~> echo a > asd; cat asd" */ /* TODO: GNL 25 leak on "msh ~> exit" */ diff --git a/src/ft_p_lcom.c b/src/ft_p_lcom.c index c7bee3c..227ab97 100644 --- a/src/ft_p_lcom.c +++ b/src/ft_p_lcom.c @@ -25,7 +25,7 @@ static void ft_rdr_err_check(char *ptr, t_lcom **link) { - if ((*link)->redir == -1 && ft_ischarset(">", *(ptr + 1))) + if ((*link)->redir == -1 && ft_ischarset("><", *(ptr + 1))) { /* TODO: syntax err */ } @@ -104,8 +104,8 @@ int8_t } ptr++; /* TODO: handle correctly multiples "msh ~> echo qwe > qwe > asd >> zxc > qweasdzxc" */ - /* hint: bash only handles the last onke */ - /* TODO: handle "msh ~> cat < Makefile >qwe" */ + /* hint: bash only handles the last one */ + /* TODO: handle "msh ~> cat < Makefile >qwe" | gl hf */ } if ((*link)->redir > 0) { @@ -132,6 +132,7 @@ int8_t i = 0; if (!(words = ft_split(line, ';'))) return (-1); + ft_printf("words1 (%s) | words2 (%s)\n", *words, *(words + 1)); while (i <= count) { if (!(link = ft_lcom_new(words[i]))) diff --git a/src/ft_p_lcom_next.c b/src/ft_p_lcom_next.c index 626bf50..df312bc 100644 --- a/src/ft_p_lcom_next.c +++ b/src/ft_p_lcom_next.c @@ -18,6 +18,7 @@ char **ft_subst_args(const char word[], int8_t redir) { + /* TODO: norme */ char **words; char *subst; size_t i; @@ -39,7 +40,10 @@ char if (!(subst = ft_substr(word, 0, i))) return (NULL); if (!(words = ft_split(subst, ' '))) + { + ft_memdel((void*)&subst); return (NULL); + } ft_memdel((void*)&subst); return (words); } diff --git a/src/ft_s_lcom.c b/src/ft_s_lcom.c index 2bf4622..33ad5da 100644 --- a/src/ft_s_lcom.c +++ b/src/ft_s_lcom.c @@ -33,7 +33,9 @@ static int8_t ft_strlcpy((*lcom)->com, words[0], ft_strlen(words[0]) + 1); while(words[i]) { - if (ft_ischarset("<>0123456789", words[i][0])) + /* TODO: cut fd number "msh ~> echo a 2>file" */ + /* ^ */ + if (ft_ischarset("<>", words[i][0])) break ; i++; } |