diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-04-26 21:24:08 +0200 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-04-26 21:24:08 +0200 |
commit | f6517910eb0d6032a0678698d364987fb62158a5 (patch) | |
tree | e4fa4a3c5b29ce8d1a1174f8b6ff0529b2210421 /src/ft_u_vars.c | |
parent | Better subst (diff) | |
download | 42-minishell-f6517910eb0d6032a0678698d364987fb62158a5.tar.gz 42-minishell-f6517910eb0d6032a0678698d364987fb62158a5.tar.bz2 42-minishell-f6517910eb0d6032a0678698d364987fb62158a5.tar.xz 42-minishell-f6517910eb0d6032a0678698d364987fb62158a5.tar.zst 42-minishell-f6517910eb0d6032a0678698d364987fb62158a5.zip |
gdb time, strsubst might be broken
Diffstat (limited to '')
-rw-r--r-- | src/ft_u_vars.c | 12 |
1 files changed, 7 insertions, 5 deletions
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; |