summaryrefslogtreecommitdiffstats
path: root/src/s_com.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/s_com.c13
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);