aboutsummaryrefslogtreecommitdiff
path: root/src/get_cmd_path.c
diff options
context:
space:
mode:
authorChristopher Uhlig2025-01-25 13:01:10 +0100
committerChristopher Uhlig2025-01-25 13:01:10 +0100
commit87b90103930d83d74baa998866b0995cb8887d51 (patch)
tree0eb876341c2794f2165b83c1d339fb3b38e9f711 /src/get_cmd_path.c
parent18fb7cb8ae69fc3439266a154aa6b0f947d6805d (diff)
downloadminishell-87b90103930d83d74baa998866b0995cb8887d51.tar.gz
minishell-87b90103930d83d74baa998866b0995cb8887d51.zip
fixed leaks in tokenizer and collectargs also fixed seg for < > and improved value add by $ use
Diffstat (limited to 'src/get_cmd_path.c')
-rw-r--r--src/get_cmd_path.c29
1 files changed, 2 insertions, 27 deletions
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 <chuhlig@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* 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;