diff options
| author | Dominik Kaiser | 2025-01-15 16:37:29 +0100 |
|---|---|---|
| committer | Dominik Kaiser | 2025-01-15 16:37:29 +0100 |
| commit | 1d0c010ad0634e5fba061b91bec0b0f2badc293c (patch) | |
| tree | e87eb1432863c942365e5ea0825cede63b7c7f28 /src | |
| parent | 64a413a49ed7979aad9a1eede5ba25c267884839 (diff) | |
| download | minishell-1d0c010ad0634e5fba061b91bec0b0f2badc293c.tar.gz minishell-1d0c010ad0634e5fba061b91bec0b0f2badc293c.zip | |
Remove error function from get_cmd_path.c
Diffstat (limited to 'src')
| -rw-r--r-- | src/get_cmd_path.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/src/get_cmd_path.c b/src/get_cmd_path.c index 11100bc..7c5e103 100644 --- a/src/get_cmd_path.c +++ b/src/get_cmd_path.c @@ -6,7 +6,7 @@ /* By: chuhlig <chuhlig@student.42.fr> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/12/17 19:19:59 by chuhlig #+# #+# */ -/* Updated: 2025/01/15 16:34:56 by dkaiser ### ########.fr */ +/* Updated: 2025/01/15 16:37:18 by dkaiser ### ########.fr */ /* */ /* ************************************************************************** */ @@ -14,14 +14,13 @@ #include "minishell.h" #include <errno.h> #include <sys/errno.h> +#include <sys/stat.h> #include <sys/unistd.h> #include <unistd.h> -#include <sys/stat.h> static char *get_simple_cmd_path(char *cmd, int *return_code); static char *get_absolute_cmd_path(char *cmd, t_env *env, int *return_code); static char *find_in_path(char *cmd, t_env *env, int *return_code); -static void *error(int err_code, char *err_text, int exit_code, int *ret_code); char **get_split_path(t_env *env); static int is_directory(char *path); @@ -111,15 +110,6 @@ static char *get_simple_cmd_path(char *cmd, int *return_code) return (result); } -static void *error(int err_code, char *err_text, int exit_code, int *ret_code) -{ - errno = err_code; - perror(err_text); - if (ret_code != NULL) - *ret_code = exit_code; - return (NULL); -} - static int is_directory(char *path) { struct stat path_stat; |
