From 446a7655b671d9818e6a1daf5ee675ad09f90757 Mon Sep 17 00:00:00 2001 From: mcolonna Date: Tue, 25 Jun 2024 15:45:27 +0200 Subject: [PATCH] fix: TODO and FIXME in the files --- include/cool_readline.h | 4 ++-- include/parse_command.h | 3 +-- src/exec_command.c | 9 +++------ 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/include/cool_readline.h b/include/cool_readline.h index 325a3da..f2a3352 100644 --- a/include/cool_readline.h +++ b/include/cool_readline.h @@ -6,14 +6,14 @@ /* By: mcolonna +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/06/18 13:41:32 by mcolonna #+# #+# */ -/* Updated: 2024/06/18 13:43:42 by mcolonna ### ########.fr */ +/* Updated: 2024/06/25 15:42:54 by mcolonna ### ########.fr */ /* */ /* ************************************************************************** */ #ifndef COOL_READLINE_H # define COOL_READLINE_H -// Same than readline, but (TODO) +// Same than readline, but do not echo control characters like '^C' char *cool_readline(const char *prompt); #endif diff --git a/include/parse_command.h b/include/parse_command.h index 44d1d0d..1b36349 100644 --- a/include/parse_command.h +++ b/include/parse_command.h @@ -6,7 +6,7 @@ /* By: jschaft +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/04/23 14:15:12 by mcolonna #+# #+# */ -/* Updated: 2024/06/21 16:22:20 by mcolonna ### ########.fr */ +/* Updated: 2024/06/25 15:43:15 by mcolonna ### ########.fr */ /* */ /* ************************************************************************** */ @@ -50,7 +50,6 @@ typedef struct s_pipes // If error, return a t_command wth the value .error = true. t_command parse_command(t_env *env, const char *command); -// TODO reorganize const char *variables_get(t_list *variables, const char *name); #endif diff --git a/src/exec_command.c b/src/exec_command.c index 40b1a42..b15bcdb 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/06/25 13:40:07 by mcolonna ### ########.fr */ +/* Updated: 2024/06/25 15:45:58 by mcolonna ### ########.fr */ /* */ /* ************************************************************************** */ @@ -43,8 +43,7 @@ static void close_all_pipes(t_exec_command_global *global) // Execute a program with specific stdin and stdout: // - inout[0] is stdin // - inout[0] is stdout -// If call.program doesn't start with "./" or "/", find the program in $PATH. -// (TODO) +// If call.program doesn't have any '/' in it, find the program in $PATH. // If the program wasn't to found in $PATH, or the fork didn't work, // write the error and return the error status. static int execute_call( @@ -58,8 +57,7 @@ static int execute_call( call.program); if (!program_path) return (minishell_error(str_join(fatal_error, global->mc, - "command not found: ", str_join(fatal_error, global->mc, - call.program, "\n"))), 127); + "command not found: ", call.program)), 127); pid = fork(); if (pid < 0) return (minishell_error("errno"), errno); @@ -113,7 +111,6 @@ static int exec_each_call(t_exec_command_global *global, return (r); } -// FIXME line jump if command not found int execute_command(t_env *env, t_command command) { t_exec_command_global global;