working on builtin execution in pipes
This commit is contained in:
@ -6,7 +6,7 @@
|
||||
/* By: marde-vr <marde-vr@42angouleme.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/03/05 18:20:21 by marde-vr #+# #+# */
|
||||
/* Updated: 2024/04/21 23:25:05 by tomoron ### ########.fr */
|
||||
/* Updated: 2024/04/22 12:33:58 by marde-vr ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -25,8 +25,8 @@ int cmd_is_builtin(t_msh *msh, char *cmd_token)
|
||||
{
|
||||
if (!cmd_token)
|
||||
return (0);
|
||||
else if (msh->in_type == PIPE || msh->out_type == PIPE)
|
||||
return (1);
|
||||
//else if (msh->in_type == PIPE || msh->out_type == PIPE)
|
||||
// return (1);
|
||||
else if (!ft_strcmp(cmd_token, "cd"))
|
||||
{
|
||||
cd(msh->tokens);
|
||||
|
@ -6,7 +6,7 @@
|
||||
/* By: marde-vr <marde-vr@42angouleme.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/03/28 13:50:14 by tomoron #+# #+# */
|
||||
/* Updated: 2024/04/21 21:52:10 by tomoron ### ########.fr */
|
||||
/* Updated: 2024/04/22 12:40:41 by marde-vr ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
/* By: marde-vr <marde-vr@42angouleme.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/03/05 18:17:25 by marde-vr #+# #+# */
|
||||
/* Updated: 2024/04/21 23:49:47 by tomoron ### ########.fr */
|
||||
/* Updated: 2024/04/22 12:47:51 by marde-vr ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -31,8 +31,7 @@ void execute_command(t_msh *msh, char **cmd_args)
|
||||
{
|
||||
char **env;
|
||||
|
||||
if (msh->tokens->value && (!ft_strcmp(msh->tokens->value, "cd")
|
||||
|| !ft_strcmp(msh->tokens->value, "exit") || exec_builtin(msh)))
|
||||
if (exec_builtin(msh))
|
||||
{
|
||||
free(cmd_args);
|
||||
ft_exit(msh, g_return_code);
|
||||
|
Reference in New Issue
Block a user