update: changed getenv calls by get_env
This commit is contained in:
@@ -6,7 +6,7 @@
|
|||||||
/* By: sede-san <sede-san@student.42madrid.com +#+ +:+ +#+ */
|
/* By: sede-san <sede-san@student.42madrid.com +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2025/10/28 13:03:44 by sede-san #+# #+# */
|
/* Created: 2025/10/28 13:03:44 by sede-san #+# #+# */
|
||||||
/* Updated: 2025/10/29 20:37:09 by sede-san ### ########.fr */
|
/* Updated: 2025/12/01 13:51:37 by sede-san ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
@@ -58,11 +58,9 @@ static char *solve_path(
|
|||||||
if (path_is_solved(cmd_name))
|
if (path_is_solved(cmd_name))
|
||||||
// return a copy to avoid double free on parent
|
// return a copy to avoid double free on parent
|
||||||
return (ft_strdup(cmd_name));
|
return (ft_strdup(cmd_name));
|
||||||
//TODO substitute getenv call for own getenv
|
path = ft_split(get_env("PATH", msh), COLON);
|
||||||
path = ft_split(getenv("PATH"), COLON);
|
|
||||||
if (!path)
|
if (!path)
|
||||||
return (NULL);
|
return (NULL);
|
||||||
(void)msh;
|
|
||||||
cmd_path = NULL;
|
cmd_path = NULL;
|
||||||
i = -1;
|
i = -1;
|
||||||
while (!cmd_path && path[++i])
|
while (!cmd_path && path[++i])
|
||||||
|
|||||||
Reference in New Issue
Block a user