From f6517910eb0d6032a0678698d364987fb62158a5 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Sun, 26 Apr 2020 21:24:08 +0200 Subject: gdb time, strsubst might be broken --- src/ft_u_vars.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/ft_u_vars.c') diff --git a/src/ft_u_vars.c b/src/ft_u_vars.c index 619e83d..99f35bb 100644 --- a/src/ft_u_vars.c +++ b/src/ft_u_vars.c @@ -63,6 +63,7 @@ static char t_msh *msh) { char **p_env; + char *pp_env; char *varval; p_env = msh->envp; @@ -70,11 +71,12 @@ static char { if (!ft_strncmp(rvarname, *p_env, ft_strlen(rvarname))) { - while (**p_env != '\0' && **p_env != '=') - *p_env += 1; - if (**p_env == '=') - *p_env += 1; - varval = ft_dup_env(*p_env, rvarname, msh); + pp_env = *p_env; + while (*pp_env != '\0' && *pp_env != '=') + pp_env += 1; + if (*pp_env == '=') + pp_env += 1; + varval = ft_dup_env(pp_env, rvarname, msh); return (varval); } p_env += 1; -- cgit v1.2.3