This commit is contained in:
whaffman 2025-02-11 16:45:30 +01:00
parent 21b3245ebf
commit ed7a23eeb3

View File

@ -6,7 +6,7 @@
/* By: willem <willem@student.codam.nl> +#+ */ /* By: willem <willem@student.codam.nl> +#+ */
/* +#+ */ /* +#+ */
/* Created: 2025/02/08 17:00:24 by willem #+# #+# */ /* Created: 2025/02/08 17:00:24 by willem #+# #+# */
/* Updated: 2025/02/08 19:27:05 by willem ######## odam.nl */ /* Updated: 2025/02/11 16:45:17 by whaffman ######## odam.nl */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -15,6 +15,7 @@
char *executor_absolute_path(t_list *env, char *cmd) char *executor_absolute_path(t_list *env, char *cmd)
{ {
char **path; char **path;
t_environment *path_env;
char *executable; char *executable;
int i; int i;
@ -29,9 +30,10 @@ char *executor_absolute_path(t_list *env, char *cmd)
} }
return (NULL); return (NULL);
} }
path = ft_split(environment_get(env, "PATH")->value, ':'); path_env = environment_get(env, "PATH");
if (!path) if (!path_env)
return (NULL); return (NULL);
path = ft_split(path_env->value, ':');
i = 0; i = 0;
while (path[i] != NULL) while (path[i] != NULL)
{ {