diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-08-04 14:44:55 +0200 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-08-04 14:44:55 +0200 |
commit | 647a984ac6b6e2629ad16d3892ad3c231e8e277a (patch) | |
tree | ea96eb4f73efa946f100f77538ad1149a8f2de05 /src/u_vars.c | |
parent | New libft function strclen, bug fix (diff) | |
download | 42-minishell-647a984ac6b6e2629ad16d3892ad3c231e8e277a.tar.gz 42-minishell-647a984ac6b6e2629ad16d3892ad3c231e8e277a.tar.bz2 42-minishell-647a984ac6b6e2629ad16d3892ad3c231e8e277a.tar.xz 42-minishell-647a984ac6b6e2629ad16d3892ad3c231e8e277a.tar.zst 42-minishell-647a984ac6b6e2629ad16d3892ad3c231e8e277a.zip |
Huge bug fix
Diffstat (limited to 'src/u_vars.c')
-rw-r--r-- | src/u_vars.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/u_vars.c b/src/u_vars.c index 913b07b..d6ed5f2 100644 --- a/src/u_vars.c +++ b/src/u_vars.c @@ -68,7 +68,7 @@ static char p_env = msh->envp; while (*p_env) { - if (!ft_strncmp(rvarname, *p_env, ft_strlen(rvarname))) + if (!ft_strncmp(rvarname, *p_env, ft_strclen(*p_env, '='))) { pp_env = *p_env; while (*pp_env != '\0' && *pp_env != '=') @@ -86,7 +86,7 @@ static char static char *u_get_special_var(const char varname[], - t_msh *msh) + t_msh *msh) { char *varval; @@ -122,7 +122,7 @@ char ptr = msh->vars; while (ptr != NULL && - ft_strncmp(varname + 1, ptr->name, ft_strlen(varname + 1)) != 0) + ft_strncmp(varname + 1, ptr->name, ft_strlen(varname + 1) + 1) != 0) { ptr = ptr->next; } |