From 06217e697520e5c97393bc06b89fda073efa7ea6 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Tue, 1 Sep 2020 16:40:05 +0200 Subject: Update --- src/p_lcom_next.c | 47 +++++++++++++++++++++++++---------------------- 1 file changed, 25 insertions(+), 22 deletions(-) (limited to 'src/p_lcom_next.c') 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); -- cgit v1.2.3