|
|
@ -6,7 +6,7 @@ |
|
|
|
/* By: mea <mea@student.42.fr> +#+ +:+ +#+ */ |
|
|
|
/* +#+#+#+#+#+ +#+ */ |
|
|
|
/* Created: 2022/05/16 07:53:17 by narnaud #+# #+# */ |
|
|
|
/* Updated: 2022/05/18 14:44:03 by narnaud@stude ### ########.fr */ |
|
|
|
/* Updated: 2022/05/24 08:06:11 by narnaud ### ########.fr */ |
|
|
|
/* */ |
|
|
|
/* ************************************************************************** */ |
|
|
|
|
|
|
@ -75,18 +75,15 @@ char *get_var_value(t_datas *datas, char *line, int name_len) |
|
|
|
if (!ft_strncmp(name, env[0], name_len + 1)) |
|
|
|
{ |
|
|
|
if (env[1]) |
|
|
|
value = env[1]; |
|
|
|
value = ft_strdup(env[1]); |
|
|
|
else |
|
|
|
value = ft_strdup(""); |
|
|
|
free(env[0]); |
|
|
|
} |
|
|
|
else if (++i) |
|
|
|
ft_free_split(env); |
|
|
|
++i; |
|
|
|
ft_free_split(env); |
|
|
|
} |
|
|
|
free(name); |
|
|
|
if (value) |
|
|
|
free(env); |
|
|
|
else |
|
|
|
if (!value) |
|
|
|
value = ft_strdup(""); |
|
|
|
return (value); |
|
|
|
} |
|
|
|