diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-04-25 15:41:44 +0200 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-04-25 15:41:44 +0200 |
commit | f8bb8b120e6d8a207d1e34d139ecbb30653f36d6 (patch) | |
tree | fa9827b6f179035328fabfafee1e014ba31195a3 /src/ft_s_lcom.c | |
parent | strerror is nice actually (diff) | |
download | 42-minishell-f8bb8b120e6d8a207d1e34d139ecbb30653f36d6.tar.gz 42-minishell-f8bb8b120e6d8a207d1e34d139ecbb30653f36d6.tar.bz2 42-minishell-f8bb8b120e6d8a207d1e34d139ecbb30653f36d6.tar.xz 42-minishell-f8bb8b120e6d8a207d1e34d139ecbb30653f36d6.tar.zst 42-minishell-f8bb8b120e6d8a207d1e34d139ecbb30653f36d6.zip |
Nice redirs
Diffstat (limited to 'src/ft_s_lcom.c')
-rw-r--r-- | src/ft_s_lcom.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/ft_s_lcom.c b/src/ft_s_lcom.c index de09e5c..d05d84c 100644 --- a/src/ft_s_lcom.c +++ b/src/ft_s_lcom.c @@ -13,7 +13,9 @@ #include <libft.h> #include <stdlib.h> #include <stdint.h> + #include "ft_p_lcom.h" +#include "ft_p_lcom_next.h" #include "ft_s_struct.h" static int8_t @@ -32,7 +34,7 @@ static int8_t while(words[i]) { /* TODO: better <> cut ex: "msh ~> echo qwe>qwe" | gl hf */ - if (ft_ischarset("<>", words[i][0])) + if (ft_ischarset("<>0123456789", words[i][0])) break ; i++; } @@ -109,10 +111,11 @@ t_lcom link->redir = 0; link->com = NULL; link->argv = NULL; + link->rdrfd = 0; link->rdrpath = NULL; if (ft_get_redir(word, &link) != 0) return (NULL); - if (!(words = ft_split(word, ' '))) + if (!(words = ft_subst_args(word, link->redir))) return (NULL); if (ft_fill_lcom(words, &link) < 0) { |