wip
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,5 +1,7 @@
|
||||
# Prerequisites
|
||||
*.d
|
||||
todo
|
||||
|
||||
|
||||
minishell
|
||||
.minishellrc
|
||||
|
@ -6,7 +6,7 @@
|
||||
/* By: marde-vr <marde-vr@42angouleme.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* 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,6 +47,7 @@ int cmd_is_builtin(t_msh *msh, char *cmd_token)
|
||||
}
|
||||
else if(!ft_strcmp(cmd_token,"export"))
|
||||
{
|
||||
if (!(msh->in_type == PIPE || msh->out_type == PIPE))
|
||||
ft_export(msh);
|
||||
return(1);
|
||||
}
|
||||
|
@ -6,7 +6,7 @@
|
||||
/* By: marde-vr <marde-vr@42angouleme.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* 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);
|
||||
if (!eof)
|
||||
ft_exit(msh, 1);
|
||||
|
||||
/*
|
||||
get_here_doc_input(msh, eof);
|
||||
close(msh->in_fd);
|
||||
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");
|
||||
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