From 96696243d0b47b60048214d3414fb41ef191b3c4 Mon Sep 17 00:00:00 2001 From: Camille Chauvet Date: Mon, 20 Mar 2023 12:41:40 +0100 Subject: [PATCH] fix: no env is now workable --- utils/ft_get_executable.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/utils/ft_get_executable.c b/utils/ft_get_executable.c index 60976ee..fa06552 100644 --- a/utils/ft_get_executable.c +++ b/utils/ft_get_executable.c @@ -34,7 +34,10 @@ char *ft_get_executable_without_path(t_list **env, const char *name) path = NULL; paths = get_value_by_key("PATH", env); if (paths == NULL) - path = ""; + { + ft_eprintf("minishell: %s: command not found\n", name); + return (NULL); + } tab = ft_split(paths, ':'); if (tab == NULL) {