wip
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,5 +1,7 @@
|
|||||||
# Prerequisites
|
# Prerequisites
|
||||||
*.d
|
*.d
|
||||||
|
todo
|
||||||
|
|
||||||
|
|
||||||
minishell
|
minishell
|
||||||
.minishellrc
|
.minishellrc
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
/* By: marde-vr <marde-vr@42angouleme.fr> +#+ +:+ +#+ */
|
/* By: marde-vr <marde-vr@42angouleme.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2024/03/05 18:20:21 by marde-vr #+# #+# */
|
/* Created: 2024/03/05 18:20:21 by marde-vr #+# #+# */
|
||||||
/* Updated: 2024/03/21 11:03:47 by tomoron ### ########.fr */
|
/* Updated: 2024/03/23 10:18:36 by marde-vr ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
@ -47,7 +47,8 @@ int cmd_is_builtin(t_msh *msh, char *cmd_token)
|
|||||||
}
|
}
|
||||||
else if(!ft_strcmp(cmd_token,"export"))
|
else if(!ft_strcmp(cmd_token,"export"))
|
||||||
{
|
{
|
||||||
ft_export(msh);
|
if (!(msh->in_type == PIPE || msh->out_type == PIPE))
|
||||||
|
ft_export(msh);
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
else if(!ft_strcmp(cmd_token, "unset"))
|
else if(!ft_strcmp(cmd_token, "unset"))
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
/* By: marde-vr <marde-vr@42angouleme.fr> +#+ +:+ +#+ */
|
/* By: marde-vr <marde-vr@42angouleme.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2024/02/26 20:20:31 by marde-vr #+# #+# */
|
/* Created: 2024/02/26 20:20:31 by marde-vr #+# #+# */
|
||||||
/* Updated: 2024/03/05 17:45:51 by marde-vr ### ########.fr */
|
/* Updated: 2024/03/23 10:21:07 by marde-vr ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
@ -98,6 +98,8 @@ void handle_here_doc(t_msh *msh, char *eof)
|
|||||||
eof = ft_strjoin_free(eof, "\n", 1);
|
eof = ft_strjoin_free(eof, "\n", 1);
|
||||||
if (!eof)
|
if (!eof)
|
||||||
ft_exit(msh, 1);
|
ft_exit(msh, 1);
|
||||||
|
|
||||||
|
/*
|
||||||
get_here_doc_input(msh, eof);
|
get_here_doc_input(msh, eof);
|
||||||
close(msh->in_fd);
|
close(msh->in_fd);
|
||||||
msh->in_fd = open(here_doc_file, O_RDWR, 0644);
|
msh->in_fd = open(here_doc_file, O_RDWR, 0644);
|
||||||
@ -106,4 +108,19 @@ void handle_here_doc(t_msh *msh, char *eof)
|
|||||||
perror("open");
|
perror("open");
|
||||||
ft_exit(msh, 1);
|
ft_exit(msh, 1);
|
||||||
}
|
}
|
||||||
|
}*/
|
||||||
|
|
||||||
|
int pid = fork();
|
||||||
|
if (pid == 0)
|
||||||
|
get_here_doc_input(msh, eof);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
close(msh->in_fd);
|
||||||
|
msh->in_fd = open(here_doc_file, O_RDWR, 0644);
|
||||||
|
if (msh->in_fd == -1)
|
||||||
|
{
|
||||||
|
perror("open");
|
||||||
|
ft_exit(msh, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user