summaryrefslogtreecommitdiffstats
path: root/src/ft_s_lcom.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-04-25 15:41:44 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2020-04-25 15:41:44 +0200
commitf8bb8b120e6d8a207d1e34d139ecbb30653f36d6 (patch)
treefa9827b6f179035328fabfafee1e014ba31195a3 /src/ft_s_lcom.c
parentstrerror is nice actually (diff)
download42-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.c7
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)
{