compiles now
This commit is contained in:
@ -6,7 +6,7 @@
|
|||||||
/* By: marde-vr <marde-vr@42angouleme.fr> +#+ +:+ +#+ */
|
/* By: marde-vr <marde-vr@42angouleme.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2024/03/28 13:50:14 by tomoron #+# #+# */
|
/* Created: 2024/03/28 13:50:14 by tomoron #+# #+# */
|
||||||
/* Updated: 2024/04/23 17:01:43 by tomoron ### ########.fr */
|
/* Updated: 2024/04/23 17:07:41 by tomoron ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
@ -188,10 +188,10 @@ void end_execution(t_msh *msh, int cmd_count)
|
|||||||
print_signaled(status);
|
print_signaled(status);
|
||||||
if(msh->here_doc_filename)
|
if(msh->here_doc_filename)
|
||||||
{
|
{
|
||||||
unlink(msh->here_doc_filename)
|
unlink(msh->here_doc_filename);
|
||||||
free(msh->here_doc_filename);
|
free(msh->here_doc_filename);
|
||||||
msh->here_doc_filename = 0;
|
msh->here_doc_filename = 0;
|
||||||
{
|
}
|
||||||
free(msh->pids);
|
free(msh->pids);
|
||||||
free_fds(msh);
|
free_fds(msh);
|
||||||
msh->pids = 0;
|
msh->pids = 0;
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
/* By: marde-vr <marde-vr@42angouleme.fr> +#+ +:+ +#+ */
|
/* By: marde-vr <marde-vr@42angouleme.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2024/03/24 17:44:32 by marde-vr #+# #+# */
|
/* Created: 2024/03/24 17:44:32 by marde-vr #+# #+# */
|
||||||
/* Updated: 2024/04/23 16:59:17 by tomoron ### ########.fr */
|
/* Updated: 2024/04/23 17:07:00 by tomoron ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
@ -36,7 +36,7 @@ void get_here_doc_input(t_msh *msh, char *eof)
|
|||||||
free(line);
|
free(line);
|
||||||
}
|
}
|
||||||
|
|
||||||
void here_doc_child(t_msh *msh, char *eof, char *here_doc_file)
|
void here_doc_child(t_msh *msh, char *eof)
|
||||||
{
|
{
|
||||||
here_doc_variables(1, msh);
|
here_doc_variables(1, msh);
|
||||||
signal(SIGINT, signal_handler_here_doc);
|
signal(SIGINT, signal_handler_here_doc);
|
||||||
@ -77,7 +77,7 @@ void handle_here_doc(t_msh *msh, char *eof)
|
|||||||
}
|
}
|
||||||
pid = fork();
|
pid = fork();
|
||||||
if (pid == 0)
|
if (pid == 0)
|
||||||
here_doc_child(msh, eof, here_doc_file);
|
here_doc_child(msh, eof);
|
||||||
else
|
else
|
||||||
here_doc_signal(msh, pid, here_doc_file);
|
here_doc_signal(msh, pid, here_doc_file);
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
/* By: marde-vr <marde-vr@42angouleme.fr> +#+ +:+ +#+ */
|
/* By: marde-vr <marde-vr@42angouleme.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2024/02/04 17:31:38 by tomoron #+# #+# */
|
/* Created: 2024/02/04 17:31:38 by tomoron #+# #+# */
|
||||||
/* Updated: 2024/04/23 16:52:15 by tomoron ### ########.fr */
|
/* Updated: 2024/04/23 17:05:54 by tomoron ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
@ -79,7 +79,7 @@ typedef struct s_msh
|
|||||||
extern int g_return_code;
|
extern int g_return_code;
|
||||||
|
|
||||||
t_cmd *cmd_add_back(t_cmd *res, char *cmd, t_cmd_type type);
|
t_cmd *cmd_add_back(t_cmd *res, char *cmd, t_cmd_type type);
|
||||||
void *here_doc_variables(int write, int index, void *data);
|
void *here_doc_variables(int write, void *data);
|
||||||
int add_var_to_str(char *res, char **command, t_env *env);
|
int add_var_to_str(char *res, char **command, t_env *env);
|
||||||
void find_cmd_path(t_msh *msh, char **paths, int *found);
|
void find_cmd_path(t_msh *msh, char **paths, int *found);
|
||||||
t_env *env_add_back(t_env *env, char *name, char *value);
|
t_env *env_add_back(t_env *env, char *name, char *value);
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
/* By: marde-vr <marde-vr@42angouleme.fr> +#+ +:+ +#+ */
|
/* By: marde-vr <marde-vr@42angouleme.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2024/03/22 14:31:13 by tomoron #+# #+# */
|
/* Created: 2024/03/22 14:31:13 by tomoron #+# #+# */
|
||||||
/* Updated: 2024/04/23 16:59:02 by tomoron ### ########.fr */
|
/* Updated: 2024/04/23 17:05:37 by tomoron ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
@ -31,9 +31,9 @@ void *here_doc_variables(int write, void *data)
|
|||||||
static void *variable;
|
static void *variable;
|
||||||
|
|
||||||
if (write)
|
if (write)
|
||||||
variables = data;
|
variable = data;
|
||||||
else
|
else
|
||||||
return (variables);
|
return (variable);
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user