summaryrefslogtreecommitdiffstats
path: root/src/s_init.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-09-06 22:12:15 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2020-09-06 22:12:15 +0200
commit6805673bff96379c03ba32e681f8fb40aad52adc (patch)
treeb1a9b1978ba4f7577e8544bcccf8ccc08c360037 /src/s_init.c
parentCool (diff)
download42-minishell-6805673bff96379c03ba32e681f8fb40aad52adc.tar.gz
42-minishell-6805673bff96379c03ba32e681f8fb40aad52adc.tar.bz2
42-minishell-6805673bff96379c03ba32e681f8fb40aad52adc.tar.xz
42-minishell-6805673bff96379c03ba32e681f8fb40aad52adc.tar.zst
42-minishell-6805673bff96379c03ba32e681f8fb40aad52adc.zip
Improvement
Diffstat (limited to '')
-rw-r--r--src/s_init.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/s_init.c b/src/s_init.c
index 8fc8a79..55f9cf0 100644
--- a/src/s_init.c
+++ b/src/s_init.c
@@ -169,12 +169,13 @@ t_msh
return (NULL);
/* TODO: shname: care about "./", try with symlinks */
msh->envp = NULL;
- if (!(msh->envp = dupenv(envp)))
+ if ((msh->envp = dupenv(envp)) == NULL)
return (NULL);
msh->ret = 0;
init_buptr(msh);
msh->curr = NULL;
msh->vars = NULL;
+ msh->hist[0] = '\0';
set_cwd(cwd, msh);
if ((msh->cwd = ft_strdup(cwd)) == NULL)
return (NULL);