fix: non nuiltins is now startable

This commit is contained in:
Camille Chauvet
2023-03-10 13:34:23 +01:00
parent 1a4ed128e7
commit 087a96e54b
7 changed files with 20 additions and 21 deletions

View File

@ -5,7 +5,7 @@ char *ft_get_executable_with_path(const char *name)
{
char *path;
if (access(name, F_OK) == 0)
if (access(name, F_OK) != 0)
{
ft_eprintf("minishell: %s bash: No such file or directery\n");
return (NULL);
@ -50,7 +50,7 @@ char *ft_get_executable_without_path(t_list **env, const char *name)
ft_eprintf("minishell: malloc failed\n");
break;
}
if (access(path, X_OK))
if (access(path, X_OK) == 0)
break;
free(path);
path = NULL;