diff options
Diffstat (limited to 'src/p_lcom_next.c')
-rw-r--r-- | src/p_lcom_next.c | 47 |
1 files changed, 25 insertions, 22 deletions
diff --git a/src/p_lcom_next.c b/src/p_lcom_next.c index b04d393..28ad821 100644 --- a/src/p_lcom_next.c +++ b/src/p_lcom_next.c @@ -76,29 +76,32 @@ char int8_t redir) { char **words; - char *subst; - size_t i; - if (redir == 0) - { - if (!(words = ft_split(word, ' '))) - return (NULL); - return (words); - } - i = 0; - while (word[i] && ft_ischarset("<>", word[i]) == FALSE) - i++; - while (redir > 0 && ft_isdigit(word[i]) == TRUE) - i--; - 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); + /* char **words; */ + /* char *subst; */ + /* size_t i; */ + + /* if (redir == 0) */ + /* { */ + /* if (!(words = ft_split(word, ' '))) */ + /* return (NULL); */ + /* return (words); */ + /* } */ + /* i = 0; */ + /* while (word[i] && ft_ischarset("<>", word[i]) == FALSE) */ + /* i++; */ + /* while (redir > 0 && ft_isdigit(word[i]) == TRUE) */ + /* i--; */ + /* 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); */ } char @@ -184,7 +187,7 @@ static char k = i; while (i - k < j) { - if (!(rewords[i - k] = ft_strdup(words[i]))) + if ((rewords[i - k] = ft_strdup(words[i])) == NULL) { ft_delwords(words); f_alloc_and_destroy_msh(msh); |