summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-08-04 15:59:45 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2020-08-04 15:59:45 +0200
commit979276aa838118dad6cf31615b30093a761b35aa (patch)
treeeb1a8c5090561e5a5fa56439e02f9c3624587b93
parentMerge branch 'master' into fix-pwd (diff)
download42-minishell-979276aa838118dad6cf31615b30093a761b35aa.tar.gz
42-minishell-979276aa838118dad6cf31615b30093a761b35aa.tar.bz2
42-minishell-979276aa838118dad6cf31615b30093a761b35aa.tar.xz
42-minishell-979276aa838118dad6cf31615b30093a761b35aa.tar.zst
42-minishell-979276aa838118dad6cf31615b30093a761b35aa.zip
sec
-rw-r--r--src/s_init.c4
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);
}