|
@ -54,6 +54,8 @@ void exe(t_datas *datas, t_command *cmd) |
|
|
|
|
|
|
|
|
if (ft_strchr(cmd->argv[0], '/')) |
|
|
if (ft_strchr(cmd->argv[0], '/')) |
|
|
execve(cmd->argv[0], cmd->argv, datas->envp); |
|
|
execve(cmd->argv[0], cmd->argv, datas->envp); |
|
|
|
|
|
else |
|
|
|
|
|
{ |
|
|
path_dirs = ft_split(getenv("PATH"), ':'); |
|
|
path_dirs = ft_split(getenv("PATH"), ':'); |
|
|
while (path_dirs) |
|
|
while (path_dirs) |
|
|
{ |
|
|
{ |
|
@ -66,6 +68,7 @@ void exe(t_datas *datas, t_command *cmd) |
|
|
free(path); |
|
|
free(path); |
|
|
path_dirs++; |
|
|
path_dirs++; |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
pid_t caller(t_datas *datas, t_command *cmd) |
|
|
pid_t caller(t_datas *datas, t_command *cmd) |
|
|