From 8a1352d62c0dd66ecdd5807e83c16a00fb864635 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Thu, 27 Aug 2020 17:47:04 +0200 Subject: Histfile is BAV --- src/m_init.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/m_init.c') diff --git a/src/m_init.c b/src/m_init.c index c145063..8b8a994 100644 --- a/src/m_init.c +++ b/src/m_init.c @@ -10,17 +10,27 @@ /* */ /* ************************************************************************** */ +#include #include #include "s_struct.h" +#include "u_vars.h" #include "u_vars_next.h" void m_init_custom_vars(t_msh *msh) { + char *home; + char fmt[255]; + u_subst_var_value("$PS1", FT_DEFAULT_PS_ONE, msh); u_subst_var_value("$PS2", FT_DEFAULT_PS_TWO, msh); u_subst_var_value("$PS3", FT_DEFAULT_PS_THR, msh); u_subst_var_value("$PS4", FT_DEFAULT_PS_FOU, msh); - u_subst_var_value("$HISTFILE", FT_DEFAULT_HISTFILE, msh); + if ((home = u_get_var_value("$HOME", msh)) != NULL) + { + ft_sprintf(fmt, "%s/%s", home, FT_DEFAULT_HISTFILE); + u_subst_var_value("$HISTFILE", fmt, msh); + ft_memdel((void*)&home); + } } -- cgit v1.2.3