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/s_com.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/s_com.c')
-rw-r--r-- | src/s_com.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/s_com.c b/src/s_com.c index 6dd4dc0..8c41040 100644 --- a/src/s_com.c +++ b/src/s_com.c @@ -19,6 +19,7 @@ #include "p_args.h" #include "p_lblock.h" #include "p_lblock_next.h" +#include "p_redirs.h" #include "s_lredir.h" #include "s_struct.h" @@ -82,8 +83,6 @@ void ft_memdel((void*)&ptr->bin); if (ptr->argv != NULL) ft_delwords(ptr->argv); - if (ptr->redir != 0) - ft_memdel((void*)&ptr->rdrpath); if (ptr->env_fork != NULL) ft_delwords(ptr->env_fork); if (ptr->rdr != NULL) @@ -102,13 +101,15 @@ t_com if ((com = (t_com*)malloc(sizeof(t_com))) == NULL) return (NULL); - com->redir = NULL; - com->bin = NULL; com->argv = NULL; com->env_fork = NULL; + com->bin = NULL; + com->rdr = NULL; nword[0] = C_NUL; + ft_printf("BEFORE: [%s]\n", nword); ft_strlcpy(nword, word, ARG_MAX); - if (p_get_redirs(nword, &com) != 0) + ft_printf("AFTER: [%s]\n", nword); + if (p_redirs(nword, &com) != 0) return (NULL); if (msh->alias != NULL) { @@ -117,7 +118,7 @@ t_com ret = p_subst_alias(nword, FALSE, msh); } p_subst_vars(nword, msh); - if ((words = p_split_args(nword, com->redir)) == NULL) + if ((words = p_split_args(nword)) == NULL) return (NULL); if ((words = p_subst_home(words, msh)) == NULL) return (NULL); |