diff --git a/src/exec/utils_exec.c b/src/exec/utils_exec.c index 859d928..44da48f 100644 --- a/src/exec/utils_exec.c +++ b/src/exec/utils_exec.c @@ -6,12 +6,13 @@ /* By: mmoussou cmd[0] != '/') { path = env_get_value("PATH", env); + if (!path || !path[0]) + { + if (path) + free(path); + path = ft_strdup(ret_cwd()); + } cmd->cmd = get_path(path, cmd->cmd); free(path); }