diff options
Diffstat (limited to 'src/s_init_next.c')
-rw-r--r-- | src/s_init_next.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/s_init_next.c b/src/s_init_next.c index d506d9d..3cc676d 100644 --- a/src/s_init_next.c +++ b/src/s_init_next.c @@ -24,11 +24,12 @@ #include "b_export_next.h" #include "f_fail.h" +#include "s_destroy.h" #include "s_struct.h" #include "u_vars.h" #include "u_vars_next.h" -void s_inc_shlvl(t_msh *msh) +char s_inc_shlvl(t_msh *msh) { char fmt[8]; char tmp[255]; @@ -49,8 +50,12 @@ void s_inc_shlvl(t_msh *msh) shlvl = (shlvl >= 999) ? 0 : shlvl; shlvl = (shlvl < 0) ? 0 : shlvl + 1; ft_itoa_s(str, shlvl); - u_subst_var_value("$SHLVL", str, msh); + if (u_subst_var_value("$SHLVL", str, msh) == 1) + { + return (1); + } } + return (0); } char **s_dupenv_del(char **nenvp, unsigned long i) |