From e5b705ff645ac19eadb789c112efc7e748df72cd Mon Sep 17 00:00:00 2001 From: tomoron Date: Tue, 23 Apr 2024 17:08:08 +0200 Subject: [PATCH] compiles now --- srcs/exec_bonus.c | 6 +++--- srcs/here_doc.c | 6 +++--- srcs/minishell.h | 4 ++-- srcs/signal_handler.c | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/srcs/exec_bonus.c b/srcs/exec_bonus.c index 8d6e32c..dd2af3e 100755 --- a/srcs/exec_bonus.c +++ b/srcs/exec_bonus.c @@ -6,7 +6,7 @@ /* By: marde-vr +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* 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); if(msh->here_doc_filename) { - unlink(msh->here_doc_filename) + unlink(msh->here_doc_filename); free(msh->here_doc_filename); msh->here_doc_filename = 0; - { + } free(msh->pids); free_fds(msh); msh->pids = 0; diff --git a/srcs/here_doc.c b/srcs/here_doc.c index 83fffd7..ac9bfa1 100755 --- a/srcs/here_doc.c +++ b/srcs/here_doc.c @@ -6,7 +6,7 @@ /* 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); } -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); signal(SIGINT, signal_handler_here_doc); @@ -77,7 +77,7 @@ void handle_here_doc(t_msh *msh, char *eof) } pid = fork(); if (pid == 0) - here_doc_child(msh, eof, here_doc_file); + here_doc_child(msh, eof); else here_doc_signal(msh, pid, here_doc_file); } diff --git a/srcs/minishell.h b/srcs/minishell.h index feeb3da..8668bde 100755 --- a/srcs/minishell.h +++ b/srcs/minishell.h @@ -6,7 +6,7 @@ /* By: marde-vr +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* 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; 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); void find_cmd_path(t_msh *msh, char **paths, int *found); t_env *env_add_back(t_env *env, char *name, char *value); diff --git a/srcs/signal_handler.c b/srcs/signal_handler.c index 9c7ab00..1e6c287 100755 --- a/srcs/signal_handler.c +++ b/srcs/signal_handler.c @@ -6,7 +6,7 @@ /* By: marde-vr +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* 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; if (write) - variables = data; + variable = data; else - return (variables); + return (variable); return (0); }