summaryrefslogtreecommitdiffstats
path: root/src/ft_u_vars.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/ft_u_vars.c12
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;