fix: no env is now workable

This commit is contained in:
Camille Chauvet 2023-03-20 12:41:40 +01:00
parent f5940ee99e
commit 96696243d0

View File

@ -34,7 +34,10 @@ char *ft_get_executable_without_path(t_list **env, const char *name)
path = NULL; path = NULL;
paths = get_value_by_key("PATH", env); paths = get_value_by_key("PATH", env);
if (paths == NULL) if (paths == NULL)
path = ""; {
ft_eprintf("minishell: %s: command not found\n", name);
return (NULL);
}
tab = ft_split(paths, ':'); tab = ft_split(paths, ':');
if (tab == NULL) if (tab == NULL)
{ {