diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-08-04 15:59:45 +0200 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-08-04 15:59:45 +0200 |
commit | 979276aa838118dad6cf31615b30093a761b35aa (patch) | |
tree | eb1a8c5090561e5a5fa56439e02f9c3624587b93 /src | |
parent | Merge branch 'master' into fix-pwd (diff) | |
download | 42-minishell-979276aa838118dad6cf31615b30093a761b35aa.tar.gz 42-minishell-979276aa838118dad6cf31615b30093a761b35aa.tar.bz2 42-minishell-979276aa838118dad6cf31615b30093a761b35aa.tar.xz 42-minishell-979276aa838118dad6cf31615b30093a761b35aa.tar.zst 42-minishell-979276aa838118dad6cf31615b30093a761b35aa.zip |
sec
Diffstat (limited to 'src')
-rw-r--r-- | src/s_init.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/s_init.c b/src/s_init.c index a0ea9a3..7bf03f7 100644 --- a/src/s_init.c +++ b/src/s_init.c @@ -89,12 +89,12 @@ t_msh msh->envp = NULL; if (!(msh->envp = dupenv(envp))) return (NULL); - msh->cwd = NULL; - msh->cwd = u_get_var_value("$PWD", msh); msh->ret = 0; init_buptr(msh); msh->curr = NULL; msh->vars = NULL; + msh->cwd = NULL; + if ((msh->cwd = u_get_var_value("$PWD", msh)) == NULL) inc_shlvl(msh); return (msh); } |