summaryrefslogtreecommitdiffstats
path: root/src/m_minishell.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/m_minishell.c')
-rw-r--r--src/m_minishell.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/m_minishell.c b/src/m_minishell.c
index e14dbdc..9306955 100644
--- a/src/m_minishell.c
+++ b/src/m_minishell.c
@@ -31,7 +31,8 @@ int
char *const envp[])
{
int32_t ret;
- char *str;
+ char *str_one;
+ char *str_two;
t_msh *msh;
/* TODO: handle general variables | $var */
@@ -41,9 +42,12 @@ int
return (FT_RET_ALLOC);
}
u_subst_var_value("$SHLVL",
- str = ft_itoa(ft_atoi(u_get_var_value("$SHLVL", msh)) + 1), msh);
- ft_memdel((void*)&str);
- lvars_add_front(&msh->vars, lvars_new("var", "value"));
+ str_one =ft_itoa(
+ ft_atoi(str_two = u_get_var_value("$SHLVL", msh)) + 1), msh);
+ ft_memdel((void*)&str_one);
+ ft_memdel((void*)&str_two);
+ /* TODO: delet this */
+ u_subst_var_value("$var", "value", msh);
ret = m_argv(argc, argv, msh);
s_destroy(msh);
return (ret);