From 87b90103930d83d74baa998866b0995cb8887d51 Mon Sep 17 00:00:00 2001 From: Christopher Uhlig Date: Sat, 25 Jan 2025 13:01:10 +0100 Subject: fixed leaks in tokenizer and collectargs also fixed seg for < > and improved value add by $ use --- src/get_cmd_path.c | 29 ++--------------------------- 1 file changed, 2 insertions(+), 27 deletions(-) (limited to 'src/get_cmd_path.c') diff --git a/src/get_cmd_path.c b/src/get_cmd_path.c index f882734..8075a5f 100644 --- a/src/get_cmd_path.c +++ b/src/get_cmd_path.c @@ -6,7 +6,7 @@ /* By: chuhlig +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/12/17 19:19:59 by chuhlig #+# #+# */ -/* Updated: 2025/01/22 16:59:48 by dkaiser ### ########.fr */ +/* Updated: 2025/01/25 11:36:28 by chuhlig ### ########.fr */ /* */ /* ************************************************************************** */ @@ -66,8 +66,7 @@ static char *find_in_path(char *cmd, t_env *env, int *return_code) char *cur_path; char *cmd_path; char **path; - char **path_start; - + char **path_start; path = get_split_path(env); path_start = path; @@ -94,30 +93,6 @@ static char *find_in_path(char *cmd, t_env *env, int *return_code) return (NULL); } -// static char *get_simple_cmd_path(char *cmd, int *return_code) -// { -// char *result; - -// result = ft_strdup(cmd); -// if (!result) -// return (NULL); -// if (access(result, F_OK) == -1) -// { -// free(result); -// return (error(ENOENT, cmd, 127, return_code)); -// } -// if (access(result, X_OK) == -1) -// { -// free(result); -// return (error(EACCES, cmd, 126, return_code)); -// } -// if (is_directory(cmd)) -// { -// free(result); -// return (error(EISDIR, cmd, 126, return_code)); -// } -// return (result); -// } static char *get_simple_cmd_path(char *cmd, int *return_code) { char *result; -- cgit v1.2.3