summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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);
}