diff options
| author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-05-07 14:33:49 +0200 | 
|---|---|---|
| committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-05-07 14:33:49 +0200 | 
| commit | d324d8b4fbdd9ca4e5426f34ea0f97d60b92e898 (patch) | |
| tree | ee428a2eb811bef0f749ba7f7c5adebd43c47e06 /src | |
| parent | Still pipin' (diff) | |
| download | 42-minishell-d324d8b4fbdd9ca4e5426f34ea0f97d60b92e898.tar.gz 42-minishell-d324d8b4fbdd9ca4e5426f34ea0f97d60b92e898.tar.bz2 42-minishell-d324d8b4fbdd9ca4e5426f34ea0f97d60b92e898.tar.xz 42-minishell-d324d8b4fbdd9ca4e5426f34ea0f97d60b92e898.tar.zst 42-minishell-d324d8b4fbdd9ca4e5426f34ea0f97d60b92e898.zip | |
UFS reinstall, will finish pipes later
Diffstat (limited to '')
| -rw-r--r-- | src/ft_e_lcom.c | 15 | ||||
| -rw-r--r-- | src/ft_m_loop.c | 8 | ||||
| -rw-r--r-- | src/ft_p_lcom.c | 5 | ||||
| -rw-r--r-- | src/ft_s_lpipes.c | 10 | 
4 files changed, 21 insertions, 17 deletions
| diff --git a/src/ft_e_lcom.c b/src/ft_e_lcom.c index 4a57f7b..3f5f81a 100644 --- a/src/ft_e_lcom.c +++ b/src/ft_e_lcom.c @@ -40,16 +40,21 @@ void  	ptr = msh->curr;  	while (ptr != NULL)  	{ -		if (ptr->com) +		if (ptr->pipes) +		{ +			ft_printf("%s\n", ptr->pipes->one->com); +			if ((bu_id = ft_get_builtin_id(ptr->pipes->one->com, msh)) +				< FT_BUILTINS_COUNT) +				ft_e_builtin(ptr->pipes->one, bu_id, msh); +			else +				ft_e_extern(ptr->pipes->one, msh); +		} +		else if (ptr->com)  		{  			if ((bu_id = ft_get_builtin_id(ptr->com, msh)) < FT_BUILTINS_COUNT) -			{  				ft_e_builtin(ptr, bu_id, msh); -			}  			else -			{  				ft_e_extern(ptr, msh); -			}  		}  		ptr = ptr->next;  	} diff --git a/src/ft_m_loop.c b/src/ft_m_loop.c index e44c85c..3f40fba 100644 --- a/src/ft_m_loop.c +++ b/src/ft_m_loop.c @@ -102,10 +102,10 @@ uint8_t              {                  ft_p_line(line, msh);                  ft_memdel((void*)&line); -                ft_e_lcom(msh); -                ft_lcom_clear(&msh->curr); -            } -            else +				ft_e_lcom(msh); +				ft_lcom_clear(&msh->curr); +			} +			else              {                  ft_m_loop_cont(msh, line, quote, 1);                  if (line != NULL) diff --git a/src/ft_p_lcom.c b/src/ft_p_lcom.c index 823db3b..a8449ae 100644 --- a/src/ft_p_lcom.c +++ b/src/ft_p_lcom.c @@ -130,7 +130,6 @@ int8_t  	/* TODO: norme */  	uint64_t		i;  	t_lcom			*link; -	struct s_lpipes	*lpipes;  	char			**words;  	t_bool			next; @@ -145,11 +144,11 @@ int8_t  		{  			if (!(link = ft_lcom_new(NULL, msh)))  				return (-1); -			if (!(lpipes = ft_split_pipes(words[i], link, msh))) +			if (!(ft_split_pipes(words[i], link, msh)))  				return (-1);  			next = TRUE;  		} -		if (next == FALSE && !(link = ft_lcom_new(words[i], NULL, msh))) +		if (next == FALSE && !(link = ft_lcom_new(words[i], msh)))  			return (-1);  		ft_lcom_add_back(&msh->curr, link);  		i++; diff --git a/src/ft_s_lpipes.c b/src/ft_s_lpipes.c index 0a637ce..dcdc2ec 100644 --- a/src/ft_s_lpipes.c +++ b/src/ft_s_lpipes.c @@ -30,7 +30,7 @@ void  	ft_lpipes_add_back(struct s_lpipes **alpipes,  					struct s_lpipes *new)  { -	t_lcom	*tmp; +	struct s_lpipes	*tmp;  	if (!*alpipes)  		*alpipes = new; @@ -47,7 +47,7 @@ void  	struct s_lpipes	*tmp;  	struct s_lpipes	*renext; -	if (!lcom) +	if (!lpipes)  		return ;  	tmp = *lpipes;  	while (tmp) @@ -82,8 +82,8 @@ struct s_lpipes  					t_lcom *lcom,  					t_msh *msh)  { -	struct s_pipes	*link; -	struct s_pipes	*lpipes; +	struct s_lpipes	*link; +	struct s_lpipes	*lpipes;  	char			**words;  	size_t			i; @@ -97,7 +97,7 @@ struct s_lpipes  		{  			return (NULL);  		} -		ft_lpipes_add_back(); +		ft_lpipes_add_back(&lcom->pipes, lpipes);  		i++;  	}  	ft_delwords(words); | 
