From 149bafef880871b40e552cae3c93c7f58ac88e5c Mon Sep 17 00:00:00 2001 From: mcolonna Date: Fri, 26 Apr 2024 12:33:38 +0200 Subject: [PATCH] check TODO --- include/include.h | 6 +++--- src/exec_command.c | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/include/include.h b/include/include.h index 2109a54..c17a69f 100644 --- a/include/include.h +++ b/include/include.h @@ -6,7 +6,7 @@ /* By: mcolonna +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/04/23 14:15:12 by mcolonna #+# #+# */ -/* Updated: 2024/04/26 12:27:17 by mcolonna ### ########.fr */ +/* Updated: 2024/04/26 12:33:20 by mcolonna ### ########.fr */ /* */ /* ************************************************************************** */ @@ -38,7 +38,7 @@ typedef struct s_call { const char *program; // path of the program to call. int argc; // number of arguments given - char *const *argv; // arguments given + char *const *argv; // arguments given (ended by NULL) // (argc and argv must include the program name) } t_call; @@ -46,7 +46,7 @@ typedef struct s_call typedef struct s_command { bool error; // true if an error occured in interpret_command(). - const t_call *calls; // all calls to programs. + const t_call *calls; // all calls to programs (ended by .program == NULL) int input_fd; // fd to use with '<' redirection (0 by default) int output_fd; // fd to use with '>' redirection (1 by default) } t_command; diff --git a/src/exec_command.c b/src/exec_command.c index 1af5a6b..50c83ca 100644 --- a/src/exec_command.c +++ b/src/exec_command.c @@ -6,7 +6,7 @@ /* By: jschaft +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/04/24 13:48:00 by jschaft #+# #+# */ -/* Updated: 2024/04/26 12:26:56 by mcolonna ### ########.fr */ +/* Updated: 2024/04/26 12:31:49 by mcolonna ### ########.fr */ /* */ /* ************************************************************************** */ @@ -26,7 +26,6 @@ static void free_tab(char **tab) free(tab); } -// TODO works with only one call (no pipe). // TODO is t_call.argv ended by NULL? static void fork_exec(const char *path, t_call call, const int inout[2], char *const envp[])