diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-09-20 15:24:18 +0200 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-09-20 15:24:18 +0200 |
commit | 00f646697e6d30d047e0b1e09ae0e55d216ce730 (patch) | |
tree | eb9a7a0734ba0caf46debb0fe7a30442f84af743 /src/p_args.c | |
parent | Redirs rework in progress (diff) | |
download | 42-minishell-00f646697e6d30d047e0b1e09ae0e55d216ce730.tar.gz 42-minishell-00f646697e6d30d047e0b1e09ae0e55d216ce730.tar.bz2 42-minishell-00f646697e6d30d047e0b1e09ae0e55d216ce730.tar.xz 42-minishell-00f646697e6d30d047e0b1e09ae0e55d216ce730.tar.zst 42-minishell-00f646697e6d30d047e0b1e09ae0e55d216ce730.zip |
In progress
Diffstat (limited to 'src/p_args.c')
-rw-r--r-- | src/p_args.c | 44 |
1 files changed, 3 insertions, 41 deletions
diff --git a/src/p_args.c b/src/p_args.c index 54a95a7..fc676a1 100644 --- a/src/p_args.c +++ b/src/p_args.c @@ -88,7 +88,7 @@ static uint16_t } static char - **p_split_words_no_rdr(const char word[]) + **p_split_words(const char word[]) { char **words; size_t start[512]; @@ -109,50 +109,12 @@ static char } char - **p_split_args(char word[], int8_t redir) + **p_split_args(char word[]) { char **words; - size_t i; words = NULL; - if (redir == 0) - { - if ((words = p_split_words_no_rdr(word)) == NULL) - return (NULL); - return (words); - } - i = ft_strlen(word); - while (ft_ischarset("<>", word[i]) == FALSE) - i--; - i--; - while (redir > 0 && ft_isdigit(word[i]) == TRUE) - i--; - word[i] = C_NUL; - if ((words = p_split_words_no_rdr(word)) == NULL) + if ((words = p_split_words(word)) == NULL) return (NULL); 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); */ } |