mirror of
https://github.com/KeyZox71/ft_minipowershell.git
synced 2025-03-15 03:16:51 +01:00
「🔨」 fix: fixed some things.
This commit is contained in:
@ -6,7 +6,7 @@
|
||||
/* By: mmoussou <mmoussou@student.42angouleme.fr +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/06/25 16:56:34 by mmoussou #+# #+# */
|
||||
/* Updated: 2024/06/25 16:59:09 by mmoussou ### ########.fr */
|
||||
/* Updated: 2024/07/16 13:20:17 by mmoussou ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -16,7 +16,8 @@ void ft_env(t_env *env)
|
||||
{
|
||||
while (env)
|
||||
{
|
||||
printf("%s=%s\n", env->name, env->content);
|
||||
if (env->content)
|
||||
printf("%s=%s\n", env->name, env->content);
|
||||
env = env->next;
|
||||
}
|
||||
}
|
||||
|
17
src/env/env_setters.c
vendored
17
src/env/env_setters.c
vendored
@ -6,7 +6,7 @@
|
||||
/* By: mmoussou <mmoussou@student.42angouleme.fr +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/05/22 14:42:52 by mmoussou #+# #+# */
|
||||
/* Updated: 2024/07/14 14:42:28 by mmoussou ### ########.fr */
|
||||
/* Updated: 2024/07/16 13:19:36 by mmoussou ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -94,15 +94,18 @@ char **env_get(t_env *env)
|
||||
i = 0;
|
||||
while (env)
|
||||
{
|
||||
ar[i] = ft_calloc(1, ft_vstrlen(2, env->name, env->content) + 2);
|
||||
if (!ar[i])
|
||||
if (env->content)
|
||||
{
|
||||
ft_free("a", ar);
|
||||
return (NULL);
|
||||
ar[i] = ft_calloc(1, ft_vstrlen(2, env->name, env->content) + 2);
|
||||
if (!ar[i])
|
||||
{
|
||||
ft_free("a", ar);
|
||||
return (NULL);
|
||||
}
|
||||
fill_env_get(env->name, env->content, ar[i]);
|
||||
i++;
|
||||
}
|
||||
fill_env_get(env->name, env->content, ar[i]);
|
||||
env = env->next;
|
||||
i++;
|
||||
}
|
||||
return (ar);
|
||||
}
|
||||
|
Reference in New Issue
Block a user